Crate tzdb

source · []
Expand description

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 2021e (released 2021-10-21).

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

Usage examples

use tz::{DateTime, TimeZone};
use tzdb::TimeZoneExt;

// access by identifier
DateTime::now(tzdb::time_zone::europe::KIEV);
// access by name
DateTime::now(TimeZone::from_db("Europe/Berlin").unwrap());
// names are case insensitive
DateTime::now(TimeZone::from_db("ArCtIc/LongYeArByEn").unwrap());

Feature flags

Modules

serde_asserde-as

Helper functions to be used with serde

All defined time zones statically accessible

Traits

Import this trait to extend tz::TimeZone’s functionality