Documentation

tzdata-rs

Timezone library for the Rust programming language (doc)

Build Status Crate Version

Usage

Add the following in your Cargo.toml:

[dependencies]
tzdata = "0.*"

And put this in your crate root:

extern crate tzdata;

Example

The library provides basic support for timezone conversion.

let utc = tzdata::Timezone::utc();
let now = utc.now();

for tzname in &["Europe/Paris", "America/New_York", "Asia/Seoul"] {
    let tz = tzdata::Timezone::new(tzname).unwrap();
    let now = now.project(&tz);
    println!("it is now {:?} in {}", now, tz.name);
}