Skip to content

tz

I M P O R T A N T

Timezone is NOT the same as an offset. A regional Timezone doesn't always map to a canonical Timezone

If you want historical data (pre-1970), compile with -D HISTORICAL_TZ

Since "Illegal States must not be representable", there is no "DateTime" class (which canonically in almost every language represents a Date/Time in UTC). We have only ZonedDateTime which defaults to UTC.

High Level (Separate Date / Times)

  • Date class for date math, leap year checks, day of week, etc…
  • Time class for time math within a single day.

High Level (Dates / Times / TimeZones)

  • ZonedDateTime class contains a POSIX (sec, nanosec) UTC timestamp and associated TimeZone / Offset.

    • Constructors for .now(), and .from_posix(), and timezone'd versions such as .from_posix_in_zone(), .now_at_offset() etc…
    • Ability to "cast" time between timezones (to_timezone / to_timezone_in_place) — same UTC instant, re-resolved local fields for the new zone.
    • Comparisons across zones are DST-safe because every ZDT carries a UTC POSIX instant; compare via to_posix() and the local DST quirks of either side don't enter the comparison.
  • Parsers and Formatters for various date ISO/RFC formats:

  • rfc2822/rfc5322 Example:
    • Sun, 25 May 2026 12:00:00 -0700
  • rfc3339 / iso8601 Examples:
    • 1985-04-12T23:20:50.52Z
    • 1996-12-19T16:39:57-08:00
    • 1990-12-31T23:59:59Z
    • 1937-01-01T12:00:27.87+00:20

High Level (Calendaring Functions):

  • WeekdayIter "Every weekday in Array[DayOfWeek] at the same time in the same Zone".
  • MonthlyIter "Every (DayOfMonth | LastDayOfMonth | LastWeekdayOfMonth) of the month".
  • IntervalIter "Every N minutes / hours" — pure-intraday Periods today; calendar-mixed Periods (months / days) are planned.

... and much much more.

Public Types