public DateTime(text as String, timeZone as TimeZone = TimeZone.local):
Constructs a DateTime by parsing an ISO 8601 date-time string.
| 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)