I'm looking for a table to convert all of the Olson TZIDs to Windows time zones. I have found:
.NET TimeZoneInfo from Olson time zone
Which is great and can be built from the info at:
http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml
but unfortunately it only maps some of the TZIDs to the Windows time zones. Has anyone come across (or produced) a full table?
I converted the XML http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml to JSON at https://github.com/uddhav/tzid-from-geo/blob/master/olson_to_windows.json. 430 in all.
I recently needed this mapping for a c++ application. The unicode mapping covers most of the zones but there are a few issues.
First, many of the olson/tz ids have aliases. The ids used in the unicode mapping do not include these aliases. For a more complete mapping your application needs to also understand aliases.
The following defines olson/tz aliases: http://www.unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml
For example, the unicode mapping has no definition for 'America/Argentina/Buenos_Aires', but looking in the above file we see that 'America/Argentina/Buenos_Aires' is in fact an alias for 'America/Buenos_Aires' which does exist in the mapping file.
Second, there are some olson/tz ids that are not mappable to any Windows time zone. This can happen because Windows doesn't have a time zone with the same offset or DST rules. In these cases there really is no conversion possible. Most of these zones are small islands, so it could be an edge case not worth considering.
For more info on this see: http://cldr.unicode.org/development/development-process/design-proposals/extended-windows-olson-zid-mapping
The comma separated list below consists of these three columns:
[Windows Time Zone ID],[Region],[Olson TZID]
Sourced from Zone to Tzid and separated lines with multiple TZID options into individual lines.
The list:
OK, so I have had a bash at putting together a table. I'm quite sure there are lots of inaccuracies and there are many zones that don't map, but it will do for my purposes for now. I've also put the table up at the following URL. If anyone has any corrections or additions, please let me know and I will add/change them.
http://www.snae.net/tzids.csv
Update, the following page also looks to have good info: http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml
Had to cut due to restrictions on post size - get the full CSV at the linked address.
The problem with a static table is that it has to be maintained as changes to the TZDB and CLDR are released.
The better solution is to use a library that can do the conversions for you, and will stay on top of the updates for you.
Noda Time is the perfect choice for this. I have already documented how to convert between IANA/Olson and Windows time zones in this post: How to translate between Windows and IANA time zones?
As new updates to the TZDB and CLDR are released, you can simply get the latest version of Noda Time, or you can update it manually by following the instructions here.