Temporal
tyrus:temporal provides native values for absolute instants, calendar dates, clock times, durations, zoned date-times, and checked-in IANA time zones. Every fallible native API in the module reports recoverable failures as Result<T, TemporalError>; non-fallible operations such as value equality return their direct value.
Available APIs
| API | Purpose |
|---|---|
Instant | Absolute points on the timeline. |
PlainDate | Calendar dates without a time or time zone. |
PlainTime | Clock times without a date or time zone. |
PlainDateTime | Calendar dates combined with clock times. |
ZonedDateTime | Instants associated with an IANA time zone. |
Duration | Signed calendar and clock units. |
TimeZone | The checked-in IANA time-zone enum and resolver. |
PlainYearMonth | Calendar year and month values. |
PlainMonthDay | Recurring month and day values. |
Import
Imports
import { Instant, PlainDate, TimeZone, instantNow, plainDateFrom, timeZone } from "tyrus:temporal";