DateTime.AddSeconds

Syntax

AddSeconds(Value: DateTime; Count: Integer): DateTime;

Parameters

Value - initial date.

Count - the number of added seconds.

Description

The AddSeconds method adds the specified number of seconds to the initial date passed as the Value parameter.

Example

Sub Main;

Var

DT, DT1, DT2, DT3, DT4: DateTime;

Begin

DT := DateTime.Parse("01.01.2004 10:20:20");

DT1 := DateTime.AddSeconds(DT, 1);

DT2 := DateTime.AddSeconds(DT, 80);

DT3 := DateTime.AddSeconds(DT, 3600);

DT4 := DateTime.AddSeconds(DT, -90);

End Sub Main;

After executing the example the "DT", "DT1", "DT2" and "DT3" and "DT4" variables will contain the following values:

"DT" - "01.01.2004 10:20:20"

"DT1" - "01.01.2004 10:20:21"

"DT2" - "01.01.2004 10:21:40"

"DT3" - "01.01.2004 11:20:20"

"DT4" - "01.01.2004 10:18:50"

See also:

DateTime