Crate iana_time_zone
get the IANA time zone for the current system
This small utility crate provides the
get_timezone() function.
// Get the current time zone as a string.
let tz_str = get_timezone?;
println!;
# Ok::
The resulting string can be parsed to a
chrono-tz::Tz
variant like this:
let tz_str = iana_time_zone::get_timezone()?;
let tz: chrono_tz::Tz = tz_str.parse()?;
Enums
- GetTimezoneError Error types
Functions
- get_timezone Get the current IANA time zone as a string.