DateUtils.WithinPastYears
From RAD Studio VCL Reference
Contents |
Delphi Information
From DateUtils.pas
function WithinPastYears(const ANow: TDateTime; const AThen: TDateTime; const AYears: Integer): Boolean;
Unit: DateUtils
Type: function
Visibility: public
C++ Information
From DateUtils.hpp
bool __fastcall WithinPastYears(System::TDateTime ANow, System::TDateTime AThen, int AYears);
Unit: DateUtils
Type: function
Description
Indicates whether two date/time values are within a specified number of years of each other.
Call WithinPastYears to determine whether the date specified by ANow is within AYears years of the date specified by AThen.
Note: WithinPastYears uses the YearsBetween function, which means that fractional years do not count. If ANow and AThen are two and a half years apart, calling WithinPastYears with AYears set to 2 returns True.
See Also
Code Samples