Reputation: 2353
Microsoft defined a list of all timezones and their name.
E.g. 110 W. Europe Standard Time (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
The name of the timezone is wrong, because it should be Central European Time instead of Western.
Perphaps you know a solution to retrieve a correct list of timezones?
Upvotes: 0
Views: 963
Reputation: 241808
A few things:
The page you linked to is only valid for Windows Embedded 1.1 - an ancient and deprecated product. That page is for historical reference only. Microsoft does not maintain a web page with the list of time zones supported in modern Windows and .NET, because the values change often as the world's time zones are updated as a result of geopolitical changes. Instead, use .NET's TimeZoneInfo.GetSystemTimeZones()
, or tzutil.exe /l
on the command line.
The value you described is similar to the DisplayName
property returned on a TimeZoneInfo
object when the OS language is English. These values are primarily for time zone selection - that is, picking a time zone from a drop down list of available time zones. As such, Windows elects to provide city names for some of the time zones, rather than the broader colloquial names.
To get a value like "Central European Time"
, you would need to use data from the Unicode CLDR project, or from a library that consumes that data. The data is given in many different languages, so you will need to know both the identifier of the time zone, and the language/locale that you are interested in.
One such library that gives CLDR data for time zones in .NET is TimeZoneNames - of which I am the author. Using this library is straightforward. Once installed from Nuget, just call TZNames.GetNamesForTimeZone
and pass either a an IANA time zone identifier, or a Windows time zone identifier, along with an IETF language tag for the language/locale you are interested in. The samples in the project readme explain further.
Upvotes: 1