This documentation is archived and is not being maintained.

TimeZoneInfo::AdjustmentRule::Equals Method (TimeZoneInfo::AdjustmentRule)

Determines whether the current TimeZoneInfo::AdjustmentRule object is equal to a second TimeZoneInfo::AdjustmentRule object.

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

public:
virtual bool Equals(
	TimeZoneInfo..::..AdjustmentRule^ other
) sealed

Parameters

other
Type: System::TimeZoneInfo::AdjustmentRule
The object to compare with the current object.

Return Value

Type: System::Boolean
true if both TimeZoneInfo::AdjustmentRule objects have equal values; otherwise, false.

Implements

IEquatable<T>::Equals(T)

To determine whether two TimeZoneInfo::AdjustmentRule objects are equal, the Equals(TimeZoneInfo::AdjustmentRule) method compares the member values of each object. Two adjustment rules are equal if they have the same effective dates, the same delta, and identical values for the TimeZoneInfo::TransitionTime objects returned by their DaylightTransitionStart and DaylightTransitionEnd properties.

The following example calls the TimeZoneInfo::AdjustmentRule::Equals(TimeZoneInfo::AdjustmentRule) method to compare the adjustment rules for Central Standard Time with those for Canada Central Standard Time and Mexico Standard Time.

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

This code displays the following output to the console:

Comparing Central Standard Time rule for 1/1/0001 to 12/31/9999 with:
   Canada Central Standard Time has no adjustment rules.
   Mexican CST for 1/1/0001 to 12/31/9999: Equal

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: