Sign in Join
FPDoc Onlineexperiment

IncSecond function

In unit DateUtils

Increase a TDateTime value with a number of seconds.

Declaration

pascal
function IncSecond(const AValue: TDateTime; 
 const ANumberOfSeconds: Int64): TDateTime

Arguments

AValue

TDateTime to which seconds should be added.

ANumberOfSeconds

Number of seconds to add.

Function result

TDateTime representing AValue plus ANumberOfSeconds seconds.

Description

IncSecond adds ANumberOfSeconds seconds to AValue and returns the resulting date/time. ANumberOfSeconds can be positive or negative.

See also

Example: ex77

pascal
Program Example77;

{ This program demonstrates the IncSecond function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One Second from now is ',TimeToStr(IncSecond(Time,1)));
  Writeln('One Second ago from now is ',TimeToStr(IncSecond(Time,-1)));
End.

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