Unit 'DateUtils' Package
[Overview][Constants][Classes][Procedures and functions][Index] [#rtl]

IncWeek

Increase a TDateTime value with a number of weeks.

Declaration

Source position: dateutil.inc line 309

function IncWeek(

  const AValue: TDateTime;

  const ANumberOfWeeks: Integer

):TDateTime;

function IncWeek(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

  

TDateTime to which weeks should be added.

ANumberOfWeeks

  

Number of weeks to add.

Function result

TDateTime representing AValue plus ANumberOfWeeks weeks.

Arguments

AValue

  

TDateTime to which weeks should be added.

Description

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

See also

IncYear

  

Increase a TDateTime value with a number of years.

#rtl.sysutils.IncMonth

  

Increases the month in a TDateTime value with a given amount.

IncDay

  

Increase a TDateTime value with a number of days.

IncHour

  

Increase a TDateTime value with a number of hours.

IncMinute

  

Increase a TDateTime value with a number of minutes.

IncSecond

  

Increase a TDateTime value with a number of seconds.

IncMilliSecond

  

Increase a TDateTime value with a number of milliseconds.

Example

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.

Documentation generated on: Dec 10 2024