Static time zone information for tz-rs.
This crate provides all time zones found in the Time Zone Database, currently in the version 2022e (released 2022-10-12).
See the documentation for a full list the the contained time zones: https://docs.rs/tzdb/latest/tzdb/time_zone/index.html
```rust let timezone = tzdb::localtz()?; // tz::TimeZoneRef<'> let currenttime = tzdb::now::local()?; // tz::DateTime
// access by identifier let timezone = tzdb::timezone::europe::KYIV; let currenttime = tzdb::now::intz(tzdb::time_zone::europe::KYIV)?;
// access by name let timezone = tzdb::tzbyname("Europe/Berlin")?; let currenttime = tzdb::now::in_named("Europe/Berlin")?;
// names are case insensitive let timezone = tzdb::tzbyname("ArCtIc/LongYeArByEn")?; let currenttime = tzdb::now::in_named("ArCtIc/LongYeArByEn")?;
// provide a default time zone let currenttime = tzdb::now::localor(tzdb::timezone::GMT)?; let currenttime = tzdb::now::innamedor(tzdb::time_zone::GMT, "Some/City")?; ```
by-name
(enabled by default, enabled by local
) — enables tz_by_name()
to get a time zone at runtime by name
list
(enabled by default) — enables TZ_NAMES
to get a list of all shipped time zones
local
(enabled by default) — enables local_tz()
to get the system time zone
now
(enabled by default) — enables the module now
to get the current time
binary
– make the unparsed, binary tzdata of a time zone available
std
(enabled by default) – enable features that need the standard library std
alloc
(enabled by default, enabled by std
) – enable features that need the standard library alloc
fallback
(enabled by default) — compile for unknown target platforms, too
The main
branch gets squashed regularily to keep the size of the repository at a maintainable size.
To get the history until then, please refer to the id in the initial commit.