#date #time #timezone #zone #calendar

tzdb

Static time zone information for tz-rs

19 releases

Uses new Rust 2021

new 0.2.7 Jun 29, 2022
0.2.6 Jun 29, 2022
0.2.2 Apr 15, 2022
0.2.1 Mar 27, 2022
0.0.6 Feb 24, 2022

#45 in Date and time

Download history 9/week @ 2022-03-09 76/week @ 2022-03-16 60/week @ 2022-03-23 17/week @ 2022-03-30 15/week @ 2022-04-06 21/week @ 2022-04-13 5/week @ 2022-04-20 211/week @ 2022-04-27 129/week @ 2022-05-04 239/week @ 2022-05-11 119/week @ 2022-05-18 88/week @ 2022-05-25 156/week @ 2022-06-01 62/week @ 2022-06-08 33/week @ 2022-06-15 650/week @ 2022-06-22

904 downloads per month

Apache-2.0

3MB
63K SLoC

tzdb — Time Zone Database

GitHub Workflow Status Crates.io Minimum supported Rust version License

Static time zone information for tz-rs.

This crate provides all time zones found in the Time Zone Database, currently in the version 2022a (released 2022-03-15).

See the documentation for a full list the the contained time zones: https://docs.rs/tzdb/latest/tzdb/time_zone/index.html

Usage examples

use tz::{DateTime, TimeZone};
use tzdb::{time_zone, tz_by_name};

// access by identifier
DateTime::now(time_zone::europe::KIEV);
// access by name
DateTime::now(tz_by_name("Europe/Berlin").unwrap());
// names are case insensitive
DateTime::now(tz_by_name("ArCtIc/LongYeArByEn").unwrap());

Feature flags

  • by-name (enabled by default) — enables tz_by_name() to get a time zone at runtime by name
  • list (enabled by default) — enables TZ_NAMES to get a list of all shipped time zones
  • local (enabled by default) — enables local_tz() to get the system time zone
  • serde-as — enables the module serde_as to (de)serialize (Utc)DateTimes with serde
  • binary – make the unparsed, binary tzdata of a time zone available

Git cloning

The main branch gets squashed regularily to keep the size of the repository at a maintainable size. To get the history until then, please refer to the id in the initial commit.

Dependencies

~210–720KB
~13K SLoC