DateTimeComparer: IComparer;
The DateTimeComparer property returns an object to compare elements of the DateTime type.
Sub UserProc;
Var
Com: IComparer;
d, d1: DateTime;
i, i1, i2: Integer;
Begin
Com := Comparer.DateTimeComparer;
d := DateTime.Compose(2000, 01, 01, 0, 0, 0, 0);
d1 := DateTime.Compose(3000, 01, 01, 0, 0, 0, 0);
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: