DateTime.Add

Syntax

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

Parameters

Value. The date that should be increased.

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

Description

The Add method increases the date by the specified value.

Example

Sub UserProc;
Var
    DT, DT1: DateTime;
Begin
    DT := DateTime.Parse("01.01.2002 00:00:00");
    DT1 := DateTime.Add(DT, TimeSpan.Compose(22222));
End Sub UserProc;

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

See also:

DateTime | DateTime.Subtract