Subtract(Value: DateTime; Decrement: TimeSpan): DateTime;
Value. The date that should be decreased.
Decrement. The value, by which the specified date will be decreased.
The Subtract method decreases the date passed as the Value input parameter by the value passed in the Decrement parameter.
Sub UserProc;
Var
d, d1: DateTime;
Begin
d := DateTime.Parse("01.01.2002 00:00:00");
d1 := DateTime.Subtract(d, Timespan.Compose(2, 2, 2, 2, 2));
End Sub UserProc;
After executing the example the "d1" variable contains the "d" value decreased by 2 days, 2 hours, 2 minutes, 2 seconds and 2 milliseconds.
See also: