Sign in Join
FPDoc Onlineexperiment

DateTimeInRange function

In unit DateUtils

Checks whether a date/time value is in a given range.

Declaration

pascal
function DateTimeInRange(ADateTime: TDateTime; 
 AStartDateTime: TDateTime; 
 AEndDateTime: TDateTime; 
 aInclusive: Boolean=True): Boolean

Description

DateTimeInRange checks whether the value ADateTime lies between AStartDateTime and AEndDateTime, and returns True if it is. When AInclusive is True (the default), then the limits are included. When AInclusive is False, the limits are excluded.

Errors

The AStartDateTime value must be before AEndDateTime, but no check is performed.

See also

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