Generate list of Windows-like friendly time zone names on Linux .NET Core Generate list of Windows-like friendly time zone names on Linux .NET Core docker docker

Generate list of Windows-like friendly time zone names on Linux .NET Core


This is now possible with TimeZoneNames version 4.0.0.

string languageCode = CultureInfo.CurrentCulture.IetfLanguageTag; // ex: "en-US"var displayNames = TZNames.GetDisplayNames(languageCode);

The result is a dictionary where the key is the Windows ID of the time zone, and the value is the localized display name.

If you want to return IANA time zone names as keys instead, then pass true as an optional second parameter:

var displayNames = TZNames.GetDisplayNames(languageCode, true);