SubtractYrs Function |
Unit
QESBPCSDateTime
Declaration
Function SubtractYrs(const DT: TDateTime; const Yrs: Extended): TDateTime;
Description
Fractional portion of Year is assumed to be related to 365.25 day years. Time portion preserved.
If Subtracting Years results in landing on Feb 29 in a non-leap year, then this will be converted to Feb 28.This only applies to the integral component of the Years Subtracted. The fractional part always is Subtracted from the resultant Date/Time.
Parameters |
DT | Date/Time to process. |
Yrs | Number of Years to Subtract - can be negative. |
Category
Date/Time Arithmetic Routines
Year Based Arithmetic RoutinesImplementation
function SubtractYrs (const DT: TDateTime; const Yrs: Extended): TDateTime; begin Result := AddYrs (DT, -1 * Yrs); End; |
|