mitsuhiko / localzone

Figures out the local timezone as IANA / Olson identifier
Apache License 2.0
16 stars 1 forks source link

Asia/Kolkata is not supported in the timezone map, but Asia/Calcutta which is the older name is supported #3

Closed mansapabbaraju closed 1 month ago

mansapabbaraju commented 1 month ago

Thank you, this is very helpful. One issue I found while using this: Asia/Kolkata is not supported in the timezone map, but Asia/Calcutta which is the older name is supported. Same with UTC

Probably need to update the data from CLDR repository?

mitsuhiko commented 1 month ago

I assume you are referring to the windows mapping? The zone info there comes from CLDR which stores Asia/Calcutta: https://github.com/unicode-org/cldr/blob/main/common/supplemental/windowsZones.xml

Can you clarify what issue you are running into exactly?

mansapabbaraju commented 1 month ago

Yes, I am referring to the windows mapping. The issue I see is:

When I try to convert IANA timezone Asia/Kolkata to its corresponding windows timezone. You are right, this timezone is not included in the CLDR database, I saw several other complaints with this issue: For example: https://stackoverflow.com/questions/17348807/how-to-translate-between-windows-and-iana-time-zones

However, Asia/Kolkata is indeed a valid IANA timezone. To overcome this, I am creating a new map with these additional mappings in addition to using the map in this crate. Just wanted to bring this to your notice.

Calcutta is the older name of the city, and Kolkata happens to be the new name. However, it seems like CLDR has not updated its database for several years relating to this mapping

mitsuhiko commented 1 month ago

That's to be expected. You cannot assume that the mapping from IANA to windows time zone succeeds as the latter system just generally is less expressive. So while in this particular case you're observing an Asia/Kolkata timezone which at least has an alias to Asia/Calcutta you cannot assume that an IANA zone has a windows equivalent.

For instance if you observe Canada/Mountain, there is just no equivalent in Windows. The same is true for Europe/Vienna Vienna which just does not exist in Windows. There is a similar timezone called Europe/Berlin, but they are not the same zone.

I'm going to close this ticket because I don't believe this to be actionable here.

To be clear you can configure a timezone called Asia/Calcutta and it work as if it was defined as Asia/Kolkata.