SubtractSemesters Function |
Unit
QESBPCSDateTime
Declaration
Function SubtractSemesters(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 Subtracting 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 Subtracted. The fractional part always is Subtracted from the resultant Date/Time.
Parameters |
DT | Date/Time to process. |
Sems | Number of Semesters to Subtract - can be negative. |
Category
Date/Time Arithmetic RoutinesImplementation
function SubtractSemesters (const DT: TDateTime; const Sems: Extended): TDateTime; begin Result := AddMonths (DT, Sems * -6); End; |
|