Add(Value: DateTime; Increment: TimeSpan): DateTime;
Value. The date that should be increased.
Increment. The value, by which the specified date will be increased.
The Add method increases the date by the specified value.
Sub UserProc;
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 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: