regebro / tzlocal

A Python module that tries to figure out what your local timezone is

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remap CLDR translations to canonical identifiers

mattjohnsonpint opened this issue · comments

First - thanks for this library. Very useful, and it's certainly the correct approach.

There's one small issue though. The CLDR mappings (from Windows to IANA) do not necessarily use canonical identifiers. The CLDR requires stable identifiers, so when the primary name of a time zone changes, the CLDR retains the mapping to the old zone name.

There are always links in the tz data to follow, but this should probably be done as you build the win_tz map instead of being left to the end user.

For example, on Windows, if you set your time zone to "India Standard Time", tzlocal will return "Asia/Calcutta" - because that's what the CLDR points to.

But "Asia/Calcutta" is now a link to "Asia/Kolkata"- which is the primary zone. tzlocal should follow that link.

BTW - I had the same issue with Noda Time in .NET.

Although you are in principle right, I'm not sure what the problem is with this. Fixing this adds another layer of complexity, as updating the tz map required downloading and parsing the last zoneinfo files to find the links.

Closing for lack of response.