6 releases (3 breaking)
Uses old Rust 2015
0.4.1 | Jan 18, 2016 |
---|---|
0.4.0 | Jan 17, 2016 |
0.3.1 | Jan 15, 2016 |
0.2.0 | Jan 10, 2016 |
0.1.0 | Jan 9, 2016 |
#19 in #iana
38 downloads per month
Used in fitnesstrax
61KB
1.5K
SLoC
tzdata-rs
Timezone library for the Rust programming language (doc)
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);
}
lib.rs
:
tzdata
uses the IANA Time Zone Database to provide conversion between timezones.
Dependencies
~4.5MB
~91K SLoC