Function to add or subtract the number of milliseconds to the specified date.

 

Syntax

function IncMilliSecond(dt: double; iMilliSeconds: int64): double;

 

Parameters and return values

Parameter

Type

Value

dt

double

date/time value to which you need to add or subtract milliseconds;

iMilliSeconds

int64

number of milliseconds that you need to add or subtract. If the number is positive — add milliseconds, if negative — subtract.

 

Function result

Returns a date/time value shifted by a specified number of milliseconds.

 

Example

var
  dt: double;
begin
  dt := Now;
  
  mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss:zzz', dt), 'now');
  
  dt := IncMilliSecond(dt, 10000);
  mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss:zzz', dt), '+10 seconds');
end.

Script work result

[15:40:11] (Log "IncMilliSecond"): [now] 02.23.2016 15:40:11:803

[15:40:11] (Log "IncMilliSecond"): [+10 seconds] 02.23.2016 15:40:21:803

 

See also

FormatDateTime
mLogScript

Now