System.DateTime.op_Inequality Method

Determines whether two specified instances of DateTime are not equal.

Syntax

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

Parameters

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

Returns

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

Remarks

The DateTime.op_Inequality(DateTime, DateTime) operator determines whether two DateTime values are not 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