CFLib.org – Common Function Library Project

MaxDate(dt1, dt2)

Last updated September 12, 2003

author

Shawn Fairweather

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Returns larger of 2 dates.

Return Values:
Returns a date.

Example:

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

Parameters:

Name Description Required
dt1 The first date. (Is always the hardest.) Yes
dt2 The second date. Yes

Full UDF Source:

/**
 * Returns larger of 2 dates.
 * 
 * @param dt1      The first date. (Is always the hardest.) (Required)
 * @param dt2      The second date. (Required)
 * @return Returns a date. 
 * @author Shawn Fairweather (psalm_119_@hotmail.com) 
 * @version 1, September 12, 2003 
 */
function maxDate(Dt1, Dt2){
     if(DateCompare(Dt1, Dt2) IS 1) return Dt1;
     else return Dt2;
}

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