System.DateTime.Equals Method

Returns a value indicating whether the value of this instance is equal to the value of the specified DateTime instance.

Syntax

public bool Equals (DateTime value)

Parameters

value
The object to compare to this instance.

Returns

true if the value parameter equals the value of this instance; otherwise, false.

Remarks

The current instance and value are equal if their DateTime.Ticks property values are equal. Their DateTime.Kind property values are not considered in the test for equality.

This method implements the IEquatable`1 interface, and performs slightly better than the DateTime.Equals(object) method because the value parameter does not have to be converted to an object.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0