System.DateUtils.WithinPastHours

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function WithinPastHours(const ANow, AThen: TDateTime; const AHours: Int64): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall WithinPastHours(const System::TDateTime ANow, const System::TDateTime AThen, const __int64 AHours);

Properties

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

Description

Indicates whether two date/time values are within a specified number of hours of each other.

Call WithinPastHours to determine whether the date and time specified by ANow is within AHours hours of the date and time specified by AThen.

Note: WithinPastHours uses the HoursBetween function, which means that fractional hours do not count. If ANow and AThen are two and a half hours apart, calling WithinPastHours with AHours set to 2 returns True.

See Also


Code Examples