Expand description
tzdb — Time Zone Database
Static time zone information for tz-rs.
This crate provides all time zones found in the Time Zone Database, currently in the version 2022c (released 2022-08-16).
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::{time_zone, tz_by_name};
// access by identifier
DateTime::now(time_zone::europe::KYIV);
// access by name
DateTime::now(tz_by_name("Europe/Berlin").unwrap());
// names are case insensitive
DateTime::now(tz_by_name("ArCtIc/LongYeArByEn").unwrap());Feature flags
-
by-name(enabled by default, enabled bylocal) — enablestz_by_name()to get a time zone at runtime by name -
list(enabled by default) — enablesTZ_NAMESto get a list of all shipped time zones -
local(enabled by default) — enableslocal_tz()to get the system time zone -
binary— make the unparsed, binary tzdata of a time zone available -
std(enabled by default) — enable features that need the standard librarystd -
alloc(enabled by default, enabled bystd) — enable features that need the standard libraryalloc -
fallback(enabled by default) — compile for unknown target platforms, too
Modules
Constants
listA list of all known time zones
The version of the source Time Zone Database
The SHA512 hash of the source Time Zone Database (using the “Complete Distribution”)
Functions
localFind the time zone of the current system
binary and by-nameFind the raw, unparsed time zone data by name, e.g. "Europe/Berlin" (case-insensitive)
by-nameFind a time zone by name, e.g. "Europe/Berlin" (case-insensitive)