TimeZoneInfo::AdjustmentRule::Equals Method (TimeZoneInfo::AdjustmentRule^)
Determines whether the current TimeZoneInfo::AdjustmentRule object is equal to a second TimeZoneInfo::AdjustmentRule object.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- other
-
Type:
System::TimeZoneInfo::AdjustmentRule^
The object to compare with the current object.
Return Value
Type: System::Booleantrue 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.
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
Available since 3.5