IComparerClass.DateTimeComparer

Syntax

DateTimeComparer: IComparer;

Description

The DateTimeComparer property returns an object to compare elements of the DateTime type.

Example

Sub UserProc;
Var
    Com: IComparer;
    d, d1: DateTime;
    i, i1, i2: Integer;
Begin
    Com := Comparer.DateTimeComparer;
    d := DateTime.Compose(200001010000);
    d1 := DateTime.Compose(300001010000);
    i := Com.Compare(d, DateTime.Now);
    i1 := Com.Compare(d1, DateTime.Now);
    i2 := Com.Compare(d, d1);
End Sub UserProc;

After executing the example the "i, i1, i2" variables contain the "-1, 1, -1" values respectively.

See also:

IComparerClass