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

Download history 1696/week @ 2024-01-01 1783/week @ 2024-01-15 159/week @ 2024-01-22 14/week @ 2024-02-19 84/week @ 2024-02-26 32/week @ 2024-03-04 28/week @ 2024-03-11 6/week @ 2024-03-18 7/week @ 2024-03-25 32/week @ 2024-04-01

82 downloads per month

MIT license

24KB
412 lines

rust-tz Build Status

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