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

# IncHour

Increase a TDateTime value with a number of hours.

## Declaration

Source position: dateutil.inc line 304

`function IncHour(`
`const AValue: TDateTime;`
`const ANumberOfHours: Int64`
`):TDateTime; function IncHour(`
`const AValue: TDateTime`
`):TDateTime;`

## Arguments

`AValue` |  | TDateTime to which hours should be added.
`ANumberOfHours` |  | Number of hours to add

## Function result

TDateTime representing AValue plus ANumberOfHours hours.

## Arguments

`AValue` |  | TDateTime to which hours should be added.

## Description

IncHour adds ANumberOfHours hours to AValue and returns the resulting date/time.ANumberOfHours 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.
IncWeek |  | Increase a TDateTime value with a number of weeks.
IncDay |  | Increase a TDateTime value with a number of days.
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 Example75
    ;

    { This program demonstrates the IncHour function }

    Uses SysUtils,DateUtils;

    Begin
      Writeln('One Hour from now is ',DateTimeToStr(IncHour(Now,1)));
      Writeln('One Hour ago from now is ',DateTimeToStr(IncHour(Now,-1)));
    End.

Documentation generated on: May 14 2021