Export (0) Print
Expand All

TimeZoneInfo.TransitionTime.Equals Method (TimeZoneInfo.TransitionTime)

Determines whether the current TimeZoneInfo.TransitionTime object has identical values to a second TimeZoneInfo.TransitionTime object.

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

public bool Equals(
	TimeZoneInfo.TransitionTime other
)

Parameters

other
Type: System.TimeZoneInfo.TransitionTime

An object to compare to the current instance.

Return Value

Type: System.Boolean
true if the two objects have identical property values; otherwise, false.

Implements

IEquatable<T>.Equals(T)

To determine whether the two TimeZoneInfo.TransitionTime objects are equal, this method performs a property-by-property comparison. The method returns true only if the current TimeZoneInfo.TransitionTime object and the other object have identical values for each of the TimeZoneInfo.TransitionTime object's six property values.

The following example illustrates calls to the Equals method.

TimeZoneInfo.TransitionTime tt1 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 02, 00, 00), 11, 03);
TimeZoneInfo.TransitionTime tt2 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 02, 00, 00), 11, 03);
TimeZoneInfo.TransitionTime tt3 = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(new DateTime(1, 1, 1, 02, 00, 00), 10, 05, DayOfWeek.Sunday);
Console.WriteLine(tt1.Equals(tt1));        // Returns True (an object always equals itself)
Console.WriteLine(tt1.Equals(tt2));        // Returns True (identical property values)
Console.WriteLine(tt1.Equals(tt3));        // Returns False (different property values)

.NET Framework

Supported in: 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft