System.DateUtils.WithinPastMonths
Delphi
function WithinPastMonths(const ANow, AThen: TDateTime; const AMonths: Integer): Boolean;
C++
extern DELPHI_PACKAGE bool __fastcall WithinPastMonths(const System::TDateTime ANow, const System::TDateTime AThen, const int AMonths);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.DateUtils.pas System.DateUtils.hpp |
System.DateUtils | System.DateUtils |
Description
Indicates whether two date/time values are within a specified number of months of each other.
Call WithinPastMonths to determine whether the date specified by ANow is within AMonths months of the date specified by AThen.
Note: WithinPastMonths uses the MonthsBetween function, which means that fractional months do not count. If ANow and AThen are two and a half months apart, calling WithinPastMonths with AMonths set to 2 returns True.
See Also