Skip to content

IncMilliSecond ​

IncMilliSecond returns the given date, incremented by the number of milliseconds given as the ANumberOfMilliSeconds parameter.

ANumberOfMilliSeconds can be negative, to return a date, earlier by the specified number of milliseconds.

The time of day specified by AValue is copied to the result.

Declaration: Function IncMilliSecond(const AValue: TDateTime; const ANumberOfMilliSeconds: Int64): TDateTime;

This is a simple example.

pascal
procedure OnMapEvent(var Value:Variant);
var
  TheDate, ThatDate, BackDate : TDateTime;
begin
 //Returns a date changed by 100 milliseconds
  TheDate := Now;
  ThatDate := IncMilliSecond(TheDate, 100);
  BackDate := IncMilliSecond(TheDate,-100);
  LogInfo(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', TheDate));
  LogInfo(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', ThatDate));
  LogInfo(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', BackDate));
end;