C# TimeZone GetDaylightChanges

Description

TimeZone GetDaylightChanges returns the daylight saving time period for a particular year.

Syntax

TimeZone.GetDaylightChanges has the following syntax.


public abstract DaylightTime GetDaylightChanges(
  int year
)

Parameters

TimeZone.GetDaylightChanges has the following parameters.

  • year - The year that the daylight saving time period applies to.

Returns

TimeZone.GetDaylightChanges method returns A System.Globalization.DaylightTime object that contains the start and end date for daylight saving time in year.

Example


using System;//from   ww  w. ja v a  2 s  . c om
using System.Globalization;

class TimeZoneDemo
{
    static void Main( )
    {
        // Get the local time zone and the current local time and year.
        TimeZone localZone = TimeZone.CurrentTimeZone;
        Console.WriteLine(localZone.GetDaylightChanges(2014) );
    } 
} 

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version