tzdb — Time Zone Database
Static time zone information for tz-rs.
This crate provides all time zones found in the Time Zone Database.
Usage examples
let time_zone = local_tz?; // tz::TimeZoneRef<'_>
let current_time = local?; // tz::DateTime
// access by identifier
let time_zone = KYIV;
let current_time = in_tz?;
// access by name
let time_zone = tz_by_name?;
let current_time = in_named?;
// names are case insensitive
let time_zone = tz_by_name?;
let current_time = in_named?;
// provide a default time zone
let current_time = local_or?;
let current_time = in_named_or?;
Feature flags
-
local(enabled by default) — enableslocal_tz()to get the system time zone -
now(enabled by default) — enables the modulenowto get the current time -
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