#timezone #windows #enums #cldr #unicode #chrono #list

no-std bin+lib windows-timezones

Windows timezone list from the Unicode CLDR project

7 unstable releases

0.4.0 Aug 19, 2024
0.3.1 Apr 18, 2024
0.3.0 Jul 7, 2023
0.2.1 Jul 4, 2023
0.1.0 Feb 7, 2023

#362 in Database interfaces

Download history 76/week @ 2024-07-19 70/week @ 2024-07-26 65/week @ 2024-08-02 72/week @ 2024-08-09 250/week @ 2024-08-16 84/week @ 2024-08-23 60/week @ 2024-08-30 54/week @ 2024-09-06 80/week @ 2024-09-13 98/week @ 2024-09-20 95/week @ 2024-09-27 76/week @ 2024-10-04 51/week @ 2024-10-11 64/week @ 2024-10-18 135/week @ 2024-10-25 133/week @ 2024-11-01

395 downloads per month

(MIT OR Apache-2.0) AND Unicode-DFS-2016

120KB
2K SLoC

Windows Timezones

github crates.io docs.rs

This crate takes the list of Windows' (the OS) default timezones[^1] from the Unicode CLDR project's supplemental data files and converts it into a Rust enum that allows for retrieving the Windows timezone description and the corresponding default tzdb ID.

The enum variants are guaranteed to be stay consistent within the same major version of the crate.

SQLx support

When the sqlx feature is enable sqlx::Type is derived for the WindowsTimezone type. The supported PostgreSQL type is kept in the schema.sql file of this repository. On major version updates you need to ensure that your PostgreSQL type matches the scheam.sql file of the new version!

Features

  • chrono-tz: Implements From<WindowsTimezone> for chrono_tz::Tz.
  • schemars: Derives schemars::JsonSchema.
  • serde: Derives serde::Serialize and serde::Deserialize.
  • sqlx: Derives sqlx::Type.
  • strum: Derives strum::EnumIter.

[^1]: See the official Windows documentation. Note that the CLDR list is more up-to-date than the actual Windows documentation page.

Dependencies

~0–10MB
~111K SLoC