Get TimeZoneInfo that represents the local time zone in CSharp
Description
The following code shows how to get TimeZoneInfo that represents the local time zone.
Example
/*from w w w. j ava 2s .c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
TimeZoneInfo localZone = TimeZoneInfo.Local;
Console.WriteLine("Local Time Zone ID: {0}", localZone.Id);
Console.WriteLine(" Display Name is: {0}.", localZone.DisplayName);
Console.WriteLine(" Standard name is: {0}.", localZone.StandardName);
Console.WriteLine(" Daylight saving name is: {0}.", localZone.DaylightName);
}
}
The code above generates the following result.