Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TimeZoneInfo::Equals Method (TimeZoneInfo^)

 

Determines whether the current TimeZoneInfo object and another TimeZoneInfo object are equal.

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

public:
virtual bool Equals(
	TimeZoneInfo^ other
) sealed

Parameters

other
Type: System::TimeZoneInfo^

A second object to compare with the current object.

Return Value

Type: System::Boolean

true if the two TimeZoneInfo objects are equal; otherwise, false.

Equality is based on a comparison of values. Two TimeZoneInfo objects are considered to be equal under the following conditions:

  • The value of their Id property is the same.

  • They have the same adjustment rules.

TimeZoneInfo::Equals(TimeZoneInfo^) returns the Boolean value that results from evaluating the following expression:

[C#]

other.Id == this.Id && HasSameRules(other);

[Visual Basic]

other.Id = me.Id AndAlso HasSameRules(other)

If the other parameter is an uninitialized TimeZoneInfo object, this method returns false.

The following example uses the Equals(TimeZoneInfo^) method to determine whether the local time zone is Pacific Time or Eastern Time.

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

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2017 Microsoft