DateTime.AddMonths

Syntax

AddMonths(Value: DateTime; Count: Integer): DateTime;

Parameters

Value. Initial date

Count. The number of added months.

Description

The AddMonths method adds the specified number of months to the initial date.

Example

Sub UserProc;
Var
    DT, DT1, DT2: DateTime;
Begin
    DT := DateTime.Parse("01.01.2004 00:00:00");
    DT1 := DateTime.AddMonths(DT, 1);
    DT2 := DateTime.AddMonths(DT, 14);
End Sub UserProc;

After executing the example the "DT", "DT1", "DT2" variables contain the following values:

"DT" - "01.01.2004"

"DT1" - "01.02.2004"

"DT2" - "01.03.2005"

See also:

DateTime