Show: Delphi C++
Display Preferences

System.DateUtils.HoursBetween

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function HoursBetween(const ANow, AThen: TDateTime): Int64;

C++

extern DELPHI_PACKAGE __int64 __fastcall HoursBetween(const System::TDateTime ANow, const System::TDateTime AThen);

Properties

Type Visibility Source Unit Parent
function public
System.DateUtils.pas
System.DateUtils.hpp
System.DateUtils System.DateUtils

Description

Returns the number of whole hours between two specified TDateTime values.

Call HoursBetween to obtain the difference, in hours, between two TDateTime values. HoursBetween counts only entire hours. Thus, HoursBetween reports the difference between 9:00 A.M. and 9:59:59 A.M. as 0 because the difference is one second short of an entire hour.

HoursBetween always returns a positive result and therefore the parameter values are interchangeable.

See Also


Code Examples

Personal tools
In Other Languages
Previous Versions
Assistance