Sign in Join
FPDoc Onlineexperiment

IncHour function

In unit DateUtils

Increase a TDateTime value with a number of hours.

Declaration

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

Arguments

AValue

TDateTime to which hours should be added.

ANumberOfHours

Number of hours to add.

Function result

TDateTime representing AValue plus ANumberOfHours hours.

Description

IncHour adds ANumberOfHours hours to AValue and returns the resulting date/time. ANumberOfHours can be positive or negative.

See also

Example: ex75

pascal
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.

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