TimeZoneInfo.Equals Method (TimeZoneInfo)

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

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

public bool Equals(
	TimeZoneInfo 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.



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";


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.