Crate tz

Source
Expand description

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);
}

Re-exports§

pub use internals::Result;

Modules§

internals
Bare structures of time zone files

Structs§

LeapSecond
A leap second specification.
LocalTimeType
A description of the local time in a particular timezone, during the period in which the clocks do not change.
TZData
Parsed, interpreted contents of a zoneinfo file.
Transition
A time change specification.

Enums§

TransitionType
The ‘type’ of time that the change was announced in.

Functions§

cook
Interpret a set of internal time zone data.
parse
Parses a series of bytes into a timezone data structure.