C# TimeZone CurrentTimeZone
Description
TimeZone CurrentTimeZone
gets the time zone of the current
computer.
Syntax
TimeZone.CurrentTimeZone
has the following syntax.
public static TimeZone CurrentTimeZone { get; }
Example
The following example references the CurrentTimeZone property and displays the names for standard time and daylight saving time for the local time zone.
using System;/* w w w . java 2s . c o m*/
using System.Globalization;
class TimeZoneDemo
{
static void Main( )
{
TimeZone localZone = TimeZone.CurrentTimeZone;
Console.WriteLine( localZone.StandardName );
Console.WriteLine( localZone.DaylightName );
}
}
The code above generates the following result.