Globalization for GetSystemTimeZones()
Posted
by user300992
on Stack Overflow
See other posts from Stack Overflow
or by user300992
Published on 2010-05-27T14:28:25Z
Indexed on
2010/05/27
14:31 UTC
Read the original article
Hit count: 616
I want to get a list of timezones, so that i can populate the dropdown list. In .NET 3.5, we have TimeZoneInfo namespace, here is the code:
ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();
foreach (TimeZoneInfo timeZone in timeZones)
string name = timeZone.DisplayName
However, "DisplayName" is in English. How can I pass the cultureInfo so that it can return other languages? I tried setting the Thread.CurrentCulture and CurrentUICulture, it didn't work. Am I missing something?
© Stack Overflow or respective owner