Add(Value: DateTime; Increment: TimeSpan): DateTime;
Value - date that must be increased.
Increment - value, by which the specified date will be increased.
The Add method increases the date passed as the Value input parameter by the value passed in the Increment parameter.
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: