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));
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson