DateTime.AddDays

Syntax

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

Parameters

Value - initial date.

Count - the number of added days.

Description

The AddDays method adds the specified number of days to the initial date passed as the Value parameter.

Example

Sub Main;

Var

DT, DT1, DT2, DT3: DateTime;

Begin

DT := DateTime.Parse("01.01.2002 00:00:00");

DT1 := DateTime.AddDays(DT, 1);

DT2 := DateTime.AddDays(DT, 48);

DT3 := DateTime.AddDays(DT, 368);

End Sub Main;

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

"DT" - "01.01.2002"

"DT1" - "02.01.2002"

"DT2" - "18.02.2002"

"DT3" - "04.01.2003"

See also:

DateTime