libtz

Crates.iolibtz
lib.rslibtz
version0.1.1
sourcesrc
created_at2023-01-25 16:46:23.758177
updated_at2023-01-28 22:41:09.243752
descriptionIdiomatic Rust interface for libtz-sys
homepage
repositoryhttps://github.com/caldwell/libtz
max_upload_size
id767611
size15,196
David Caldwell (caldwell)

documentation

README

libtz

Idiomatic Rust interface for IANA's libtz (git repository) via libtz-sys.

Links: [Documentation] [Git Repository] [Crates.io]

Usage

Add this to your Cargo.toml:

[dependencies]
libtz = "0.1.1"

Example

use libtz::{Timezone, TimeT};
use std::time::{SystemTime, UNIX_EPOCH};

let tz = libtz::Timezone::default()?;
let tm = tz.localtime(SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() as TimeT)?;
println!("tm = {:?}", tm);
# Result::<(), Box<dyn std::error::Error>>::Ok(())

Status

This is young code and I'm not sure about the finaly interface yet. It may change rapidly.

License

Copyright © 2023 David Caldwell david@porkrind.org

MIT Licensed. See LICENSE.md for details.

Commit count: 8

cargo fmt