RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.WithinPastHours Function

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

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

DateUtils

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 2 and a half hours apart, calling WithinPastHours with AHours set to 2 returns true.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!