WithinPastWeeks indicates True if two TDateTime values are within the specified AWeeks number of weeks of each other.
WithinPastWeeks is used to determine whether the date specified by ANow is within AWeeks weeks of the date specified by AThen.
Fractional weeks do not count, so if ANow and AThen are two and a half weeks apart, calling WithinPastWeeks with AWeeks set to 2, returns True.
Declaration: function WithinPastWeeks(const ANow, AThen: TDateTime; const AWeeks: Integer): Boolean;
An example follows.