System.DateTime.op_Equality Method

Determines whether two specified instances of DateTime are equal.

Syntax

public static bool operator== (DateTime d1, DateTime d2)

See Also

DateTime.Equals(object)

Parameters

d1
The first object to compare.
d2
The second object to compare.

Returns

true if d1 and d2 represent the same date and time; otherwise, false.

Remarks

The DateTime.op_Equality(DateTime, DateTime) operator determines whether two DateTime values are equal by comparing their number of ticks. Before comparing DateTime objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their DateTime.Kind property.

Requirements

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