AddQuarters Function
Adds a Floating Point amount of Quarters to a Given Date/Time.

Unit
QESBPCSDateTime

Declaration
Function AddQuarters(const DT: TDateTime; const Qtrs: Extended): TDateTime;

Description
Fractional portion of Quarter is assumed to be related to 30 day month, as the AddMonths routine is used. Time portion preserved.

If adding Quarters results in landing on a nonsense date like 31 Apr then the last day in the month is used. This only applies to the integral component of the Quarter Added. The fractional part always is added to the resultant Date/Time.

Parameters
DT Date/Time to process.
Qtrs Number of Quarters to Add - can be negative.

Category
Date/Time Arithmetic Routines

Implementation

function AddQuarters (const DT: TDateTime; const Qtrs: Extended): TDateTime;
begin
     Result := AddMonths (DT, Qtrs * 3);
End;


HTML generated by Time2HELP
http://www.time2help.com