public DateTime(text as String, timeZone as TimeZone = TimeZone.local):
Constructs a DateTime by parsing a complete ISO 8601 date-time string. Fractional seconds may contain more than six digits; values beyond microsecond precision are truncated after the complete fraction has been validated.
| Parameter | Description |
|---|---|
text | The ISO 8601 formatted string. |
timeZone | The time zone used when the text has no explicit offset. |
import klyn.time
dt = DateTime("2025-04-18T14:30:00+02:00")
print(dt.year, dt.month, dt.day)