Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function WithinPastDays(const SomeDate, AnotherDate: TDateTime; const ADays: Integer): boolean;
Returns true if two dates are within a specified number of days of each other.
Function counts only whole days - using the DaysBetween function.
var dtNow, dtBirth : TDateTime;
DaysFromBirth : integer;
dtNow := Now;
dtBirth := EncodeDate(1973, 1, 29);
if NOT WithinPastDays(dtNow, dtBirth, 3000) then
ShowMessage('You are more than 3000 days old!')
|
TDateTime,
DaysBetween,
WithinPastYears
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|