The static TimeZone.CurrentTimeZone method returns a TimeZone object based on the current local settings : TimeZone « Date Time « C# / C Sharp






The static TimeZone.CurrentTimeZone method returns a TimeZone object based on the current local settings

   


using System;
public class MainClass {
    public static void Main() {
        TimeZone zone = TimeZone.CurrentTimeZone;
        Console.WriteLine(zone.StandardName);
        Console.WriteLine(zone.DaylightName);

    }
}

   
    
  








Related examples in the same category

1.The IsDaylightSavingTime and GetUtcOffset methods work as follows:
2.The GetDaylightChanges method returns specific daylight saving information for a given year:
3.TimeZone Info
4.Convert To TimeZone
5.Display the names for standard time and daylight saving time for the local time zone.
6.Display the current date and time and show if they occur in daylight saving time.
7.Get the current Coordinated Universal Time (UTC) and UTC offset.
8.Display the daylight saving time range for the current year.
9.Returns the daylight saving time period for a particular year.
10.Returns the Coordinated Universal Time (UTC) offset for the specified local time.
11.Whether the specified date and time is within a daylight saving time period.
12.Get UTC offset
13.Returns the Coordinated Universal Time (UTC) that corresponds to a specified time.