IncHour

Increase a TDateTime value with a number of hours.

Declaration

Source position: dateutil.inc line 291

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

Description

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

See also

Name Description
IncDay Increase a TDateTime value with a number of days.
IncMilliSecond Increase a TDateTime value with a number of milliseconds.
IncMinute Increase a TDateTime value with a number of minutes.
IncSecond Increase a TDateTime value with a number of seconds.
IncWeek Increase a TDateTime value with a number of weeks.
IncYear Increase a TDateTime value with a number of years.
#rtl.sysutils.IncMonth Increases the month in a TDateTime value with a given amount.

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.