DateTime.Add

Syntax

Add(Value: DateTime; Increment: TimeSpan): DateTime;

Parameters

Value - date that must be increased.

Increment - value, by which the specified date will be increased.

Description

The Add method increases the date passed as the Value input parameter by the value passed in the Increment parameter.

Example

Sub Main;

Var

DT, DT1: DateTime;

Begin

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

DT1 := DateTime.Add(DT, TimeSpan.Compose(2, 2, 2, 2, 2));

End Sub Main;

After executing the example the "DT1" variable will contain the value DT increased by 2 days, 2 hours, 2 minutes, 2 seconds and 2 milliseconds.

See also:

DateTime

DateTime.Subtract