Converting Olson TZID to Windows Time Zone

前端 未结 5 1158
借酒劲吻你
借酒劲吻你 2020-12-05 08:29

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 ca

5条回答
  •  [愿得一人]
    2020-12-05 08:56

    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.

提交回复
热议问题