Determines whether two specified DateTimeOffset objects refer to different points in time.
true if left and right do not have the same DateTimeOffset.UtcDateTime value; otherwise, false.
The DateTimeOffset.op_Inequality(DateTimeOffset, DateTimeOffset) method defines the operation of the inequality operator for DateTimeOffset objects. It always returns the opposite result from DateTimeOffset.op_Equality(DateTimeOffset, DateTimeOffset). The DateTimeOffset.op_Inequality(DateTimeOffset, DateTimeOffset) method enables code such as the following:
code reference: System.DateTimeOffset.Operators#8
Before evaluating the left and right operands for equality, the operator converts both values to Coordinated Universal Time (UTC). The operation is equivalent to the following:
code reference: System.DateTimeOffset.Syntax#4
In other words, the DateTimeOffset.op_Inequality(DateTimeOffset, DateTimeOffset) method determines whether the two DateTimeOffset objects represent different points in time. It directly compares neither dates and times nor offsets.
Languages that do not support custom operators can call the DateTimeOffset.Compare(DateTimeOffset, DateTimeOffset) method instead. In addition, some languages can also call the DateTimeOffset.op_Inequality(DateTimeOffset, DateTimeOffset) method directly, as the following example shows.
code reference: System.DateTimeOffset.Operators#9