DateTime.Subtract

Syntax

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

Parameters

Value - date that must be decreased.

Decrement - 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 Main;

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 Main;

After executing the example the "d1" variable will contain the "d" value decreased by 2 days, 2 hours, 2 minutes, 2 seconds and 2 milliseconds.

See also:

DateTime