Back to Blog
Utc time zone name6/29/2023 ![]() ![]() However, the UTC entry returned by TimeZoneInfo.GetSystemTimeZones() has the full form of the display name: "(UTC) Coordinated Universal Time". ![]() You are correct that = "UTC", and so does TimeZoneInfo.FindSystemTimeZoneById("UTC").DisplayName. Nor do the offsets in this list change when daylight saving time is in effect. They do not indicate whether or not the time zone adjusts for daylight saving time or not. Recognize that the offsets shown in the display names are just the base offsets. These are correct in Windows, so I think you must have added the hyphen yourself. "Coordinated" is a single non-hyphenated word. See the section on Windows time zones in the timezone tag wiki for some examples. There are many different conflicting conventions used, and some that are just made up. You should never show the IDs to the end-user or interpret them in any particular way. The DisplayName, StandardName and DaylightName properties are localized by the operating system, not by the globalization features of the. Only the values returned by the Id property are suitable for use with the FindSystemTimeZoneById method.įor your dropdown list, you should show the DisplayName, but you should store only the Id. The only solution I can figure out is to store the string "(UTC) Co-ordinated Universal Time", but I'm afraid the upper list may change in different localization. How to get the localized string that corresponds to shown in the enumeration (UTC) Co-ordinated Universal Time? TimeZoneInfo.FindSystemTimeZoneById("(UTC) Co-ordinated Universal Time") and TimeZoneInfo.FindSystemTimeZoneById("Co-ordinated Universal Time") do not work. TimeZoneInfo.FindSystemTimeZoneById("UTC") also returns "UTC". It is unusual because the upper enumeration shows different DisplayName. I want to sent the default item to (UTC) Co-ordinated Universal Time. (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna I set a winforms combobox with the time zones DisplayName: var zoneList = TimeZoneInfo ![]()
0 Comments
Read More
Leave a Reply. |