Export (0) Print
Expand All

TimeZoneInfo::AdjustmentRule Class

Updated: December 2009

Provides information about a time zone adjustment, such as the transition to and from daylight saving time.

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

[SerializableAttribute]
[HostProtectionAttribute(SecurityAction::LinkDemand, MayLeakOnAbort = true)]
[HostProtectionAttribute(SecurityAction::LinkDemand, MayLeakOnAbort = true)]
public ref class AdjustmentRule sealed : IEquatable<TimeZoneInfo..::.AdjustmentRule^>, 
	ISerializable, IDeserializationCallback

NoteNote:

The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: MayLeakOnAbort | MayLeakOnAbort. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

The TimeZoneInfo::AdjustmentRule class defines the effective start and end dates of a particular time change to and from daylight saving time, respectively, as well as its delta (the exact amount by which the adjustment causes the time zone's standard time to change). In addition, two properties return TimeZoneInfo::TransitionTime objects that define when each transition to and from standard time occurs.

NoteNote:

An instance of the TimeZoneInfo::AdjustmentRule class is immutable. Once an object has been created, its values cannot be modified.

To create a TimeZoneInfo::AdjustmentRule object, call the static (Shared in Visual Basic) TimeZoneInfo::AdjustmentRule::CreateAdjustmentRule method. You can then supply an array of TimeZoneInfo::AdjustmentRule objects to two of the overloads of the TimeZoneInfo::CreateCustomTimeZone method. To retrieve the adjustment rules of a particular time zone, call its TimeZoneInfo::GetAdjustmentRules method, which returns an array of TimeZoneInfo::AdjustmentRule objects.

The following example retrieves all time zones defined on the local system and displays complete information about their adjustment rules to the console.

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

The following is a small portion of the output generated by the example. The exact output will vary depending on the operating system and the date the example is run.

Morocco Standard Time Adjustment rules
   Adjustment rule #1
      Start Date: Tuesday, January 01, 2008
      End Date: Wednesday, December 31, 2008
      Time Change: 1:00 hours
      Annual Start: The Last Saturday of May at 11:59 PM
      Annual End: The Last Sunday of August at 11:59 PM
   Adjustment rule #2
      Start Date: Thursday, January 01, 2009
      End Date: Thursday, December 31, 2009
      Time Change: 1:00 hours
      Annual Start: The Last Sunday of May at 11:59 PM
      Annual End: The Third Thursday of August at 11:59 PM

Coordinated Universal Time has no adjustment rules

GMT Standard Time Adjustment rules
   Start Date: Monday, January 01, 0001
   End Date: Friday, December 31, 9999
   Time Change: 1:00 hours
   Annual Start: The Last Sunday of March at 1:00 AM
   Annual End: The Last Sunday of October at 2:00 AM

Greenwich Standard Time has no adjustment rules

W. Europe Standard Time Adjustment rules
   Start Date: Monday, January 01, 0001
   End Date: Friday, December 31, 9999
   Time Change: 1:00 hours
   Annual Start: The Last Sunday of March at 2:00 AM
   Annual End: The Last Sunday of October at 3:00 AM

Central Europe Standard Time Adjustment rules
   Start Date: Monday, January 01, 0001
   End Date: Friday, December 31, 9999
   Time Change: 1:00 hours
   Annual Start: The Last Sunday of March at 2:00 AM
   Annual End: The Last Sunday of October at 3:00 AM

Romance Standard Time Adjustment rules
   Start Date: Monday, January 01, 0001
   End Date: Friday, December 31, 9999
   Time Change: 1:00 hours
   Annual Start: The Last Sunday of March at 2:00 AM
   Annual End: The Last Sunday of October at 3:00 AM

Central European Standard Time Adjustment rules
   Start Date: Monday, January 01, 0001
   End Date: Friday, December 31, 9999
   Time Change: 1:00 hours
   Annual Start: The Last Sunday of March at 2:00 AM
   Annual End: The Last Sunday of October at 3:00 AM

W. Central Africa Standard Time has no adjustment rules

System::Object
  System::TimeZoneInfo::AdjustmentRule

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Date

History

Reason

December 2009

Added output from the example.

Customer feedback.

March 2009

Revised the example.

Customer feedback.

Community Additions

ADD
Show:
© 2014 Microsoft