Crates.io | iana-time-zone |
lib.rs | iana-time-zone |
version | 0.1.61 |
source | src |
created_at | 2020-06-27 11:01:58.126511 |
updated_at | 2024-09-16 14:23:34.921955 |
description | get the IANA time zone for the current system |
homepage | |
repository | https://github.com/strawlab/iana-time-zone |
max_upload_size | |
id | 258651 |
size | 173,091 |
This small utility crate gets the IANA time zone for the current system. This is also known the tz database, tzdata, the zoneinfo database, and the Olson database.
Example:
// Get the current time zone as a string.
let tz_str = iana_time_zone::get_timezone()?;
println!("The current time zone is: {}", tz_str);
You can test this is working on your platform with:
cargo run --example get_timezone
This crate has a minimum supported rust version (MSRV) of 1.48 for Tier 1 platforms.
Updates to the MSRV are sometimes necessary due to the MSRV of dependencies. MSRV updates will not be indicated as a breaking change to the semver version.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.