DateTime.Subtract

Syntax

Subtract(Value: DateTime; Decrement: TimeSpan): DateTime;

Parameters

Value. The date that should be decreased.

Decrement. The value, by which the specified date will be decreased.

Description

The Subtract method decreases the date passed as the Value input parameter by the value passed in the Decrement parameter.

Example

Sub UserProc;
Var
    d, d1: DateTime;
Begin
    d := DateTime.Parse("01.01.2002 00:00:00");
    d1 := DateTime.Subtract(d, Timespan.Compose(22222));
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:

DateTime