CFLib.org – Common Function Library Project

MinDate(dt1, dt2)

Last updated September 12, 2003

author

Shawn Fairweather

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Returns smaller of 2 dates.

Return Values:
Returns a date.

Example:

<cfset d1 = createDate(2002,1,1)>
<cfset d2 = now()>
<cfoutput>#minDate(d1,d2)#</cfoutput>

Parameters:

Name Description Required
dt1 First date. Yes
dt2 Second date. Yes

Full UDF Source:

/**
 * Returns smaller of 2 dates.
 * 
 * @param dt1 	 First date. (Required)
 * @param dt2 	 Second date. (Required)
 * @return Returns a date. 
 * @author Shawn Fairweather (psalm_119_@hotmail.com) 
 * @version 1, September 12, 2003 
 */
function minDate(Dt1, Dt2){
     if(DateCompare(Dt2, Dt1) IS 1) return Dt1;
     else return Dt2;
}
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