Topic Path: Pending > CompareDateTime@TDateTime@TDateTime
ContentsIndexHome
PreviousUpNext
CompareDateTime@TDateTime@TDateTime

Compares TDateTime values.

Parameters 
Description 
ADateTime1 
Date time value for the comparision.
 
ADateTime2 
Date time value for the comparision. 

Integer - <0 when ADateTime1 is earlier than ADateTime2, 0 when ADateTime1 and ADateTime2 are the same, or >0 when ADateTime1 is later than ADateTime2.

CompareDateTime used to compare native TDateTime values. The return value is less than 0 if ADateTime1 is less than ADateTime2, 0 if ADateTime1 equals ADateTime2, or greater than 0 if ADateTime1 is greater than ADateTime2. 

CompareDateTime allows more accurate date/time comparisons. Sometimes comparing two floating point values for equality will fail because they are of different percision and some fractions such as 1/3 and pi (7/22) can never be calculated 100% accurately.

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.