Sign in Join
FPDoc Onlineexperiment

IncWeek function

In unit DateUtils

Increase a TDateTime value with a number of weeks.

Declaration

pascal
function IncWeek(const AValue: TDateTime; const ANumberOfWeeks: Integer)
: TDateTime

Arguments

AValue

TDateTime to which weeks should be added.

ANumberOfWeeks

Number of weeks to add.

Function result

TDateTime representing AValue plus ANumberOfWeeks weeks.

Description

IncWeek adds ANumberOfWeeks weeks to AValue and returns the resulting date/time. ANumberOfWeeks can be positive or negative.

See also

Example: ex73

pascal
Program Example73;

{ This program demonstrates the IncWeek function }

Uses SysUtils,DateUtils;

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

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