public DateTime(timestamp as Timestamp, timeZone as TimeZone = TimeZone.local):
Constructs a DateTime from a timestamp.
| Parameter | Description |
|---|---|
timestamp | Timestamp representing the date and time. |
timeZone | Target timezone used for exposed components, defaulting to TimeZone.local. |
import klyn.time ts = Timestamp.now + Duration(hours=1) dt = DateTime(ts) assert dt.timeZone == TimeZone.local