WithinPastMinutes indicates True if two TDateTime values are within the specified AMinutes number of minutes of each other.
WithinPastMinutes is used to determine whether the date specified by ANow is within AMinutes minutes of the date specified by AThen.
Fractional minutes do not count, so if ANow and AThen are two and a half minutes apart, calling WithinPastMinutes with AMinutes set to 2, returns True.
Declaration: function WithinPastMinutes(const ANow, AThen: TDateTime; const AMinutes: Int64): Boolean;
An example follows.
procedure OnMapEvent(var Value:Variant);
var
TheDate, ThatDate : TDateTime;
begin
//The IF is True as less than or equal to 5 minutes