DateTime.AddMilliseconds

Syntax

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

Parameters

Value. Initial date.

Count. The number of added milliseconds.

Description

The AddMilliseconds method adds the specified number of milliseconds to the initial date.

Comments

If the Count parameter has a positive value, value of the date is increased, if negative, the date value is decreased.

Example

Sub UserProc;
Var
    DT, DT1, DT2, DT3, DT4: DateTime;
Begin
    DT := DateTime.Parse("01.01.2000 10:20:20.200");
    DT1 := DateTime.AddMilliseconds(DT, 1);
    DT2 := DateTime.AddMilliseconds(DT, 80);
    DT3 := DateTime.AddMilliseconds(DT, 1000);
    DT4 := DateTime.AddMilliseconds(DT, -90);
End Sub UserProc;

After executing the example the variables will contain the following values:

"DT" - "01.01.2000 10:20:20"

"DT1" - "01.01.2000 10:20:20.201"

"DT2" - "01.01.2000 10:20:20.280"

"DT3" - "01.01.2000 10:20:21.200"

"DT4" - "01.01.2000 10:20:20.110"

See also:

DateTime Class