Sign in Join
FPDoc Onlineexperiment

IncMilliSecond function

In unit DateUtils

Increase a TDateTime value with a number of milliseconds.

Declaration

pascal
function IncMilliSecond(const AValue: TDateTime; 
 const ANumberOfMilliSeconds: Int64): TDateTime

Arguments

AValue

TDateTime to which milliseconds should be added.

ANumberOfMilliSeconds

Number of milliseconds to add.

Function result

TDateTime representing AValue plus ANumberOfMilliSeconds milliseconds.

Description

IncMilliSecond adds ANumberOfMilliSeconds milliseconds to AValue and returns the resulting date/time. ANumberOfMilliSeconds can be positive or negative.

See also

Example: ex78

pascal
Program Example78;

{ This program demonstrates the IncMilliSecond function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One MilliSecond from now is ',TimeToStr(IncMilliSecond(Now,1)));
  Writeln('One MilliSecond ago from now is ',TimeToStr(IncMilliSecond(Now,-1)));
End.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.