TimeZone.GetDaylightChanges(Int32) Method

Definition

Returns the daylight saving time period for a particular year.

public:
 abstract System::Globalization::DaylightTime ^ GetDaylightChanges(int year);
public abstract System.Globalization.DaylightTime GetDaylightChanges (int year);
abstract member GetDaylightChanges : int -> System.Globalization.DaylightTime
Public MustOverride Function GetDaylightChanges (year As Integer) As DaylightTime

Parameters

year
Int32

The year that the daylight saving time period applies to.

Returns

A DaylightTime object that contains the start and end date for daylight saving time in year.

Exceptions

year is less than 1 or greater than 9999.

Remarks

Only one daylight saving time period per year is supported.

If daylight saving time is not used in the current time zone, the return value is a DaylightTime object, where the value of Start and End is DateTime.MinValue, and the value of DaylightTime.Delta is a TimeSpan initialized to 0 ticks.

Notes to Callers

Because the TimeZone class supports only one daylight saving time adjustment rule, the GetDaylightChanges(Int32) method applies the current adjustment rule to any year, regardless of whether the adjustment rule actually applies to that year. Assuming that the operating system itself has accurate data for a particular year, a more accurate result is available by working with the array of TimeZoneInfo.AdjustmentRule objects returned by the GetAdjustmentRules() method. The Start, End, and Delta properties correspond to the DateStart, DateEnd, and DaylightDelta properties.

Applies to

See also