klyn.time.DateTime.DateTime
constructor
public DateTime(year as Int = 1970, month as Int = 1, day as Int = 1, hour as Int = 0, minute as Int = 0, second as Int = 0, usecond as Int = 0, timeZone as TimeZone = TimeZone.local):
Description

Constructs a DateTime from individual date/time components.

Parameters
ParameterDescription
yearYear component.
monthMonth component in range 1..12.
dayDay component.
hourHour component.
minuteMinute component.
secondSecond component.
usecondMicrosecond component.
timeZoneTimezone for the provided components, defaulting to TimeZone.local.
Throws
  • ValueException if any component is outside its valid calendar range.
Example
import klyn.time
dt = DateTime(year=2023, month=10, day=5, hour=14, minute=30, second=45)