TimeZoneInfo.TransitionTime.CreateFixedDateRule Method (DateTime, Int32, Int32)

 

Defines a time change that uses a fixed-date rule (that is, a time change that occurs on a specific day of a specific month).

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static member CreateFixedDateRule : 
        timeOfDay:DateTime *
        month:int *
        day:int -> TimeZoneInfo.TransitionTime

Parameters

timeOfDay
Type: System.DateTime

The time at which the time change occurs. This parameter corresponds to the TimeOfDay property. For details, see Remarks.

month
Type: System.Int32

The month in which the time change occurs. This parameter corresponds to the Month property.

day
Type: System.Int32

The day of the month on which the time change occurs. This parameter corresponds to the Day property.

Return Value

Type: System.TimeZoneInfo.TransitionTime

Data about the time change.

Exception Condition
ArgumentException

The timeOfDay parameter has a non-default date component.

-or-

The timeOfDay parameter's Kind property is not DateTimeKind.Unspecified.

-or-

The timeOfDay parameter does not represent a whole number of milliseconds.

ArgumentOutOfRangeException

The month parameter is less than 1 or greater than 12.

-or-

The day parameter is less than 1 or greater than 31.

This method creates a fixed-date rule (that is, a time change that occurs on a specific day of a specific month). For example, a time change that always occurs on October 28 follows a fixed-date rule.

For transitions from standard time to daylight saving time, the timeOfDay argument represents the time of the transition in the time zone's standard time. For transitions from daylight saving time to standard time, it represents the time of the transition in the time zone's daylight saving time. Note that this is a DateTime value whose year, month, and date values must all equal 1.

The following example creates time zone transitions for an imaginary time zone by using both a fixed-date rule and a floating-date rule. The fixed-date rule defines a time zone adjustment that starts at 2:00 A.M. on March 15 and ends at 3:00 A.M. on November 15 for the years 1900 to 1955.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.5
Return to top
Show: