3 unstable releases
Uses old Rust 2015
0.2.1 | Sep 2, 2015 |
---|---|
0.2.0 | Jun 4, 2015 |
0.1.0 | May 31, 2015 |
#40 in #compiled
82 downloads per month
24KB
412 lines
rust-tz
This is a library for parsing the Olson zoneinfo database.
View the Rustdoc
Installation
This library uses Cargo. Just add tz
as a
dependency in your Cargo.toml
:
[dependencies]
tz = "*"
Or, for the latest development version:
[dependencies]
git = "https://github.com/ogham/rust-tz.git"
lib.rs
:
This is a library for parsing zoneinfo files.
Example
use std::fs::File;
use std::io::Read;
use std::path::Path;
use tz::parse;
let path = Path::new("/etc/localtime");
let mut contents = Vec::new();
File::open(path).unwrap().read_to_end(&mut contents).unwrap();
let tz = parse(contents).unwrap();
for t in tz.transitions {
println!("{:?}", t);
}
Dependencies
~120KB