Import std.time.zone
TimeZone
struct
Public Struct TimeZone Implements Hashable, Printable, Defaultable
A time zone: one of the time zone database's, by its name, like "Europe/Paris", or a fixed offset from UTC.
Examples
Local paris = TimeZone.Find("Europe/Paris")
Expect(paris?.Name == "Europe/Paris")
Expect(TimeZone.Utc().OffsetAt(Timestamp.UnixEpoch()) == Duration.Zero())
Local india = TimeZone.Fixed(5.Hours + 30.Minutes)
Expect(india.IsFixed && india.OffsetAt(Timestamp.Now()) == 330.Minutes)
Expect(TimeZone.Find("Mars/Olympus") == Null)-
UTC, which is also every TimeZone's zero.
-
UTC.
-
The zone of that
offsetfrom UTC, always, which panics when it isn't whole seconds under a day. -
The zone the tz database names, like "America/New_York", or one of its old names, like "US/Eastern", in any letter case; "UTC" or "Z"; or a fixed offset as ISO 8601 writes it, like "+05:30", "+0530", or "-08". Any other name is Null.
-
The OS's zone: the tz database's of the name the OS gives, or else a fixed offset, the OS's now.
-
The tz database's names, of its zones and their old names, sorted.
-
The tz database's version, like "2026e".
-
The database's name for it, like "Europe/Paris"; "UTC"; or a fixed offset's, like "+05:30".
-
Whether its offset never changes, as a fixed offset's doesn't. A database zone's can.
-
Its offset from UTC at that moment, east of it above 0.
-
The abbreviation its clocks go by then, like "CEST", or an offset, like "+0530", where the database has none. A fixed offset's is its Name.
-
Whether its clocks are on daylight saving time then, as the tz database says, which counts Europe/Dublin's winter time as its summer time turned back.
-
The offsets its clocks have when they show the date and time: one most of the time, two, the earlier moment's first, when they're turned back past it, and none when they skip it.
-
Its Name, like "Europe/Paris" or "UTC".
Report an issue with this page or with FutureBlitz on GitHub.