System.DateTimeOffset.op_LessThan Method

Determines whether one specified DateTimeOffset object is less than a second specified DateTimeOffset object.

Syntax

public static bool operator< (DateTimeOffset left, DateTimeOffset right)

Parameters

left
The first object to compare.
right
The second object to compare.

Returns

true if the DateTimeOffset.UtcDateTime value of left is earlier than the DateTimeOffset.UtcDateTime value of right; otherwise, false.

Remarks

The DateTimeOffset.op_LessThan(DateTimeOffset, DateTimeOffset) method defines the operation of the less than operator for DateTimeOffset objects. It enables code such as the following:

code reference: System.DateTimeOffset.Operators#10

Before evaluating the left and right operands, the operator converts both operands to Coordinated Universal Time (UTC). The operation is equivalent to the following:

code reference: System.DateTimeOffset.Syntax#8

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_LessThan(DateTimeOffset, DateTimeOffset) method directly, as the following example shows.

code reference: System.DateTimeOffset.Operators#11

Requirements

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