System.DateTime.Equals Method

Returns a value indicating whether two DateTime instances have the same date and time value.

Syntax

public static bool Equals (DateTime t1, DateTime t2)

Parameters

t1
The first object to compare.
t2
The second object to compare.

Returns

true if the two values are equal; otherwise, false.

Remarks

t1 and t2 are equal if their DateTime.Ticks property values are equal. Their DateTime.Kind property values are not considered in the test for equality.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0