TimeZoneInfo::AdjustmentRule::DateStart Property

 

Gets the date when the adjustment rule takes effect.

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

public:
property DateTime DateStart {
	DateTime get();
}

Property Value

Type: System::DateTime

A DateTime value that indicates when the adjustment rule takes effect.

The value of the DateStart property is a date value without a time component. It defines the date on which a particular adjustment rule goes into effect. This is the date in which a set of transitions (which typically are defined by one transition to daylight savings time and one transition back to standard time) go into effect. For example, an adjustment rule might go into effect on January 1, 2017, that provides for a transition to daylight savings time on the second Sunday of March and for a transition back to standard time on the first Sunday of November. Note that the starting date of the adjustment rule is not tied to the date of the first transition.

You can assign DateTime.MinValue.Date to the DateEnd property when you create a custom adjustment rule for use in a time zone-aware application that does not have to work with historic time zone information.

System_CAPS_importantImportant

Unless there is a compelling reason to do otherwise, you should define the adjustment rule's start date to occur within the time interval during which the time zone observes standard time. Unless there is a compelling reason to do so, you should not define the adjustment rule's start date to occur within the time interval during which the time zone observes daylight saving time. For example, if a time zone's transition from daylight saving time occurs on the third Sunday of March and its transition to daylight saving time occurs on the first Sunday of October, the effective start date of the adjustment rule should not be January 1 of a particular year, since that date occurs within the period of daylight saving time.

By default, the registry in Windows XP defines a single adjustment rule whose start date is Monday, January 01, 0001 (the value of DateTime.MinValue.Date), for each time zone. For time zones in the United States, the registry in Windows Vista defines two adjustment rules:

  • Monday, January 01, 0001, to Sunday, December 31, 2006.

  • Monday, January 01, 2007, to Friday, December 31, 9999.

This means that, although time zone adjustment rules stored in the registry are useful for performing current time zone-related operations, they cannot be reliably used for retrieving historical time zone information. For information about defining a custom time zone with multiple adjustment rules that can be used in a historical time zone-aware application, see How to: Create Time Zones with Adjustment Rules.

The following example displays information about all of the time zones defined in the local computer's system registry, including the starting and ending dates of their adjustment rules.

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

.NET Framework
Available since 3.5
Return to top
Show: