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

IncHour

Increase a TDateTime value with a number of hours.

Declaration

Source position: dateutil.inc line 313

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: Nov 23 2024