TimeZone.CurrentTimeZone : TimeZone « System « C# / C Sharp by API






TimeZone.CurrentTimeZone

  
using System;
public class MainClass {
    public static void Main() {
        TimeZone zone = TimeZone.CurrentTimeZone;
        DateTime dt1 = new DateTime(2008, 1, 1);
        DateTime dt2 = new DateTime(2008, 6, 1);
        Console.WriteLine(zone.IsDaylightSavingTime(dt1));
        Console.WriteLine(zone.IsDaylightSavingTime(dt2));
        Console.WriteLine(zone.GetUtcOffset(dt1));
        Console.WriteLine(zone.GetUtcOffset(dt2));
    }
}

   
    
  








Related examples in the same category

1.TimeZone.DaylightName
2.TimeZone.GetDaylightChanges
3.TimeZone.GetUtcOffset
4.TimeZone.IsDaylightSavingTime
5.TimeZone.StandardName