AddSemesters Function
Adds a Floating Point amount of Semesters to a Given Date/Time.

Unit
QESBPCSDateTime

Declaration
Function AddSemesters(const DT: TDateTime; const Sems: Extended): TDateTime;

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

If adding Semesters 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 Semeters Added. The fractional part always is added to the resultant Date/Time.

Parameters
DT Date/Time to process.
Sems Number of Semesters to Add - can be negative.

Category
Date/Time Arithmetic Routines

Implementation

function AddSemesters (const DT: TDateTime; const Sems: Extended): TDateTime;
begin
     Result := AddMonths (DT, Sems * 6);
End;


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