Sign in Join
FPDoc Onlineexperiment

IncDay function

In unit DateUtils

Increase a TDateTime value with a number of days.

Declaration

pascal
function IncDay(const AValue: TDateTime; const ANumberOfDays: Integer)
: TDateTime

Arguments

AValue

TDateTime value to which days should be added.

ANumberOfDays

Number of days to add.

Function result

TDateTime representing AValue plus ANumberOfDays days.

Description

IncDay adds ANumberOfDays days to AValue and returns the resulting date/time. ANumberOfDays can be positive or negative.

See also

Example: ex74

pascal
Program Example74;

{ This program demonstrates the IncDay function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One Day from today is ',DateToStr(IncDay(Today,1)));
  Writeln('One Day ago from today is ',DateToStr(IncDay(Today,-1)));
End.

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