Idiomatic Rust interface for IANA's libtz (git repository) via libtz-sys.
Links: [[Documentation](https://docs.rs/libtz/latest)] [[Git Repository](https://github.com/caldwell/libtz)] [[Crates.io](https://crates.io/crates/libtz)]
Add this to your Cargo.toml
:
toml
[dependencies]
libtz = "0.1.1"
```rust use libtz::{Timezone, TimeT}; use std::time::{SystemTime, UNIX_EPOCH};
let tz = libtz::Timezone::default()?; let tm = tz.localtime(SystemTime::now().durationsince(UNIXEPOCH)?.as_secs() as TimeT)?; println!("tm = {:?}", tm);
```
This is young code and I'm not sure about the finaly interface yet. It may change rapidly.
Copyright © 2023 David Caldwell david@porkrind.org
MIT Licensed. See LICENSE.md for details.