RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.WithinPastWeeks Function

Indicates whether two date/time values are within a specified number of weeks of each other.

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

DateUtils

Call WithinPastWeeks to determine whether the date specified by ANow is within AWeeks weeks of the date specified by AThen.

Note: WithinPastWeeks uses the WeeksBetween function, which means that fractional weeks do not count. If ANow and AThen are 2 and a half weeks apart, calling WithinPastWeeks with AWeeks set to 2 returns true.
 

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