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