RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.WithinPastDays Function

Indicates whether two dates are within a specified number of days of each other.

Pascal
function WithinPastDays(const ANow: TDateTime; const AThen: TDateTime; const ADays: Integer): Boolean;
C++
Boolean WithinPastDays(const TDateTime ANow, const TDateTime AThen, const int ADays);

DateUtils

Call WithinPastDays to determine whether the date specified by ANow is within ADays days of the date specified by AThen.

Note: WithinPastDays uses the DaysBetween function, which means that fractional days do not count. If ANow and AThen are 2 and a half days apart, calling WithinPastDays with ADays set to 2 returns true.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!