As described in the timezone tag wiki, there are two different styles of time zones.
-
Those provided by Microsoft for use with Windows and the .Net
TimeZoneInfo
class (when running on Windows) are identified by a value such as"Eastern Standard Time"
. -
Those provided by IANA in the TZDB, and used by the .NET
TimeZoneInfo
class when running on Linux or OSX, are identified by a value such as"America/New_York"
.
Many Internet-based APIs use the IANA time zones, but for numerous reasons one might need to convert this to a Windows time zone id, or vice-versa.
How can this be accomplished in .Net?