Get all the time zones about which information is available on the local system in CSharp
Description
The following code shows how to get all the time zones about which information is available on the local system.
Example
/*from www. j av a 2s .c o m*/
using System;
using System.Globalization;
using System.IO;
using System.Collections.ObjectModel;
public class Example
{
public static void Main()
{
DateTimeFormatInfo dateFormats = CultureInfo.CurrentCulture.DateTimeFormat;
ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();
foreach (TimeZoneInfo timeZone in timeZones)
{
Console.WriteLine("Daylight Name: {0, 39}", timeZone.DaylightName);
}
}
}
The code above generates the following result.