tzdb — Time Zone Database

GitHub Workflow Status Crates.io Minimum supported Rust version License

Static time zone information for tz-rs.

This crate provides all time zones found in the Time Zone Database, currently in the version 2022g (released 2022-11-29).

See the documentation for a full list the the contained time zones: https://docs.rs/tzdb/latest/tzdb/time_zone/index.html

Usage examples

```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")?; ```

Feature flags