#timezone #windows #cldr #unicode #list #chrono-tz #convert

no-std bin+lib windows-timezones

Windows timezone list from the Unicode CLDR project

5 unstable releases

0.3.0 Jul 7, 2023
0.2.1 Jul 4, 2023
0.2.0 Jul 3, 2023
0.1.1 Apr 12, 2023
0.1.0 Feb 7, 2023

#350 in Date and time

Download history 48/week @ 2023-11-20 47/week @ 2023-11-27 37/week @ 2023-12-04 52/week @ 2023-12-11 36/week @ 2023-12-18 32/week @ 2023-12-25 36/week @ 2024-01-01 33/week @ 2024-01-08 39/week @ 2024-01-15 36/week @ 2024-01-22 34/week @ 2024-01-29 39/week @ 2024-02-05 52/week @ 2024-02-12 47/week @ 2024-02-19 66/week @ 2024-02-26 66/week @ 2024-03-04

236 downloads per month

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

70KB
1.5K SLoC

Rust 1K SLoC SQL 141 SLoC

Windows Timezones

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–12MB
~128K SLoC