Registry / utility / time-tz

time-tz

JSON →
library2.0.0rscratesunverified

Implementation of tz database (IANA) for the time Rust crate, enabling timezone conversions.

# Cargo.toml [dependencies] time-tz = "2.0.0"
INSTALL
IMPORT
SIG · TIME-TZ
T
time-tz
utilityrustv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OffsetDateTimeExt
✓ use time_tz::OffsetDateTimeExt;

Converts current UTC time to New York timezone.

use time::OffsetDateTime; use time_tz::OffsetDateTimeExt; fn main() { let now = OffsetDateTime::now_utc(); let tz = time_tz::timezones::get_by_name("America/New_York").unwrap(); let local = now.to_timezone(tz); println!("{}", local); }
Debug
Known issues
gotchaRequires the `time` crate as a dependency.
fix
Add `time` to your Cargo.toml.
affects: >=2.0.0
Upgrade
Version history
2.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
time-tz — cargo add time-tz · libregistry