TimeZoneInfo::GetSystemTimeZones Method ()
Returns a sorted collection of all the time zones about which information is available on the local system.
Assembly: mscorlib (in mscorlib.dll)
The TimeZoneInfo objects, this method sets their value to an empty string ("").method retrieves all available time zone information from the subkeys of the registry's HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones key. If it is unable to successfully retrieve and parse values for particular string properties of individual
The TimeZoneInfo objects only for time zones defined in the registry. It does not include time zones created using the overloads of the CreateCustomTimeZone method. These are accessible only through the object reference returned by the time zone creation method.method returns a collection of
The collection returned by this method is sorted by UTC offset and, for time zones that have the same UTC offset, by the display name using the current culture. For information about the display name, see DisplayName.
The ReadOnlyCollection<T> object returned by this method supports the IEnumerable<T> interface, which means that it can be iterated using the foreach (in C#) or For Each…Next (in Visual Basic) statements. Each iteration of the loop provides the next TimeZoneInfo object in the collection.
The collection of TimeZoneInfo objects represents time zones defined on the local computer; it does not necessarily provide complete information for all time zones during all time periods. If your application requires time zones not found on the local computer, you can create custom time zones using the overloads of the CreateCustomTimeZone method. For more information, see How to: Create Time Zones Without Adjustment Rules and How to: Create Time Zones with Adjustment Rules.
You can also determine whether an individual time zone is defined on the local computer by calling the FindSystemTimeZoneById method and providing the identifier of the time zone you want to retrieve as a parameter.
Available since 10
Available since 3.5