[Overview][Constants][Procedures and functions][Index] Reference for unit 'dateutils' (#rtl)

PeriodBetween

Return the period (in years, months, days) between two dates

Declaration

Source position: dateutil.inc line 264

procedure PeriodBetween(

  const ANow: TDateTime;

  const AThen: TDateTime;

  out Years: Word;

  out months: Word;

  out days: Word

);

Description

PeriodBetween returns the timespan between 2 dates (ANow and AThen), expressed as a number of years, months and days in the parameters Years, months and days. Only complete years, months and days are reported.

If ANow is before AThen, their values are reversed so the result is always positive.

See also

YearsBetween

  

Calculate the number of whole years between two DateTime values

MonthsBetween

  

Calculate the number of whole months between two DateTime values

WeeksBetween

  

Calculate the number of whole weeks between two DateTime values

DaysBetween

  

Number of whole days between two DateTime values.


Documentation generated on: Nov 16 2015