RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.CompareDateTime Function

Indicates the relationship between two TDateTime values.

Pascal
function CompareDateTime(const A: TDateTime; const B: TDateTime): TValueRelationship;
C++
TValueRelationship CompareDateTime(const TDateTime A, const TDateTime B);

Call CompareDateTime to compare the two TDateTime values specified by A and B. CompareDateTime returns  

LessThanValue if A is earlier than B. 

EqualsValue if A is the same as B. 

GreaterThanValue if A is later than B.

Note: CompareDateTime differs from a direct comparison of the corresponding double precision values in that two TDateTime values are considered the same if they have the same value down to the millisecond. It is possible to create two TDateTime values that differ numerically when viewed as doubles, but which represent the same year, month, day, hour, minute, second, and millisecond.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!