regebro / tzlocal

A Python module that tries to figure out what your local timezone is
MIT License
185 stars 58 forks source link

windows_tz.py missing valid zones #151

Closed RobertD502 closed 1 year ago

RobertD502 commented 1 year ago

Although the windows_tz.py file is automatically generated from your script, the windowsZones.xml file it is generated from is missing some valid time zones.

For example, it does not contain Asia/Ho_Chi_Minh: SE Asia Standard Time or Europe/Kyiv: FLE Standard Time, which has caused issues for users attempting to use one of my projects.

Would it be possible to modify the script to have it, at the end, add any "custom" mappings that we identify to be missing in the windowsZones.xml file?

Edit: I see that your script does pull down the tzdata from iana. Would you be open to creating a separate list in the windows_tz.py file of just the timezones from the tzdata? This way, when os.environ.get("TZ") returns a value, if said TZ isn't in the tz_win dictionary, look for it in the new list and return if it is valid else return None. As it stands, if the TZ env variable has a valid value and it isn't found in the tz_win dictionary, None is returned.

regebro commented 1 year ago

Hmm, this change should be reflected in the Unicode CLDR mappings, but that hasn't happened.

I made a PR, lets see if that helps. https://unicode-org.atlassian.net/browse/CLDR-17135

RobertD502 commented 1 year ago

Thanks!

regebro commented 1 year ago

5.1 released