Equals Method (TimeZoneInfo)
Collapse the table of content
Expand the table of content

TimeZoneInfo.Equals Method (TimeZoneInfo)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

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

public bool Equals(
	TimeZoneInfo other
)

Parameters

other
Type: System.TimeZoneInfo
A second TimeZoneInfo object to compare with the current TimeZoneInfo object.

Return Value

Type: System.Boolean
true if the two TimeZoneInfo objects are equal; otherwise, false.

Implements

IEquatable<T>.Equals(T)

Equality is based on a comparison of values.

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

Version Notes

XNA Framework

 When this method is used in the XNA Framework, it throws a NotSupportedException exception.

The following example uses the Equals(TimeZoneInfo) method to determine whether a TimeZoneInfo variable is identical to the local time zone returned by the Local property.


TimeZoneInfo thisTimeZone;

thisTimeZone = TimeZoneInfo.Local;
outputBlock.Text += thisTimeZone.Equals(TimeZoneInfo.Local) + "\n";
outputBlock.Text += thisTimeZone.Equals(TimeZoneInfo.Utc) + "\n";


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft