Time partitions are divided into two types: Windows style and Iana style. Windows style time zone is used by Windows operating system and the .NET TIMEZONEINFO class running on Windows. The IANA style time zone is used by many InterNet -based APIs and the .NET TIMEZONEINFO class running on Linux or OSX.
Due to the irregularity of the time zone and the periodicity of Windows update, transformation between these time areas may be challenging. As a part of the Windowszones.xml file released by the Unicode CLDR project, the conversion provides the main data source for this conversion. However, the unpredictability of CLDR's semi -annual release plan and the changes in time zones makes it problems directly using this data.
In order to simplify the conversion process, you can get TimezoneConverter micro -library through Nuget. The following is how to use:
Please note that although the IANA time zone can be mapped to a single Windows time zone, it is not always the case. TimezoneConverter usually returns the "Golden Times" of the given Windows time zone, such as "001" in CLDR. To specify other time zones in the country/region, provide the country/region code as a parameter to the function.
The above is the detailed content of How to Convert Between Windows and IANA Time Zones in .NET?. For more information, please follow other related articles on the PHP Chinese website!