[Overview][Constants][Procedures and functions][Index] Reference for unit 'dateutils' (#rtl)

IncYear

Increase a DateTime value with a number of years.

Declaration

Source position: line 0

function IncYear(

  const AValue: TDateTime;

  const ANumberOfYears: Integer

):TDateTime;

function IncYear(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

  

DateTime to which years should be added.

ANumberOfYears

  

Number of years to add

Function result

DateTime representing AValue plus ANumberOfYears years.

Arguments

AValue

  

DateTime to which years should be added.

Function result

DateTime representing AValue plus ANumberOfYears years.

Description

IncYear adds ANumberOfYears years to AValue and returns the resulting date/time. ANumberOfYears can be positive or negative.

See also

#rtl.sysutils.IncMonth

  

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

IncWeek

  

Increase a DateTime value with a number of weeks.

IncDay

  

Increase a DateTime value with a number of days.

IncHour

  

Increase a DateTime value with a number of hours.

IncMinute

  

Increase a DateTime value with a number of minutes.

IncSecond

  

Increase a DateTime value with a number of seconds.

IncMilliSecond

  

Increase a DateTime value with a number of milliseconds.

Example

Program Example71;

{ This program demonstrates the IncYear function }

Uses SysUtils,DateUtils;

Begin
  Writeln('One year from today is ',DateToStr(IncYear(Today,1)));
  Writeln('One year ago from today is ',DateToStr(IncYear(Today,-1)));
End.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.