Globalization for GetSystemTimeZones ()

I want to get a list of time zones so that I can fill out the drop down list. In .NET 3.5, we have the 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 CultureInfo so that it can return other languages? I tried installing Thread.CurrentCulture and CurrentUICulture, this did not work. Did I miss something?

+3
source share
1 answer

It depends on the OS. Straight from the MSDN Blog :

, Windows XP Windows Server 2003, Display, Std Dlt . Display, Std Dlt . - Windows CurrentUICulture TimeZoneInfo.

, win xp server 2003 .

Vista, win7 2008 , . (MUI), -, :

MUI, Windows Vista MUI_Display, MUI_Std MUI_Dlt,

EDIT: win7, , CurrentUICulture . , - . , .

+3

Source: https://habr.com/ru/post/1747381/


All Articles