CFLib.org – Common Function Library Project

IsDateBetween(dateObj , dateObj1, dateObj2)

Last updated November 29, 2001

author

Bill King

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Returns True if the date provided in the first argument lies between the two dates in the second and third arguments.

Return Values:
Returns a Boolean.

Example:

<CFOUTPUT>
IS Today IN November of 2001? #IsDateBetween(Now(),"11/1/01","11/30/01")#
</CFOUTPUT>

Parameters:

Name Description Required
dateObj CF Date Object you want to test. Yes
dateObj1 CF Date Object for the starting date. Yes
dateObj2 CF Date Object for the ending date. Yes

Full UDF Source:

/**
 * Returns True if the date provided in the first argument lies between the two dates in the second and third arguments.
 * 
 * @param dateObj       CF Date Object you want to test. 
 * @param dateObj1      CF Date Object for the starting date. 
 * @param dateObj2      CF Date Object for the ending date. 
 * @return Returns a Boolean. 
 * @author Bill King (bking@hostworks.com) 
 * @version 1, November 29, 2001 
 */
function IsDateBetween(dateObj, dateCompared1, dateCompared2)
{
 return YesNoFormat((DateCompare(dateObj, dateCompared1) gt -1) AND (DateCompare(dateObj, dateCompared2) lt 1));
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson