DateDiff (" datepart" , " date1" , " date2") DescriptionDetermines the number of units by which date1 is less than date2. datepart can be one of the following; yyyy, year; q, quarter; m, month; y, day of year; d, day; w, weekday; ww, week; h, hour; n, minute; s, second. Example<cfset exampleDate1 = dateformat(now(), 'mm/dd/yyyy')> <cfset exampleDate2 = "12/25/2001"> <cfoutput> How many weeks since Christmas: #DateDiff("ww", exampleDate1, exampleDate2)# </cfoutput> |