You need to determine the difference between two dates or times.
Use dateDiff() to return the interval between two dates and/or times. The dateDiff() function is used to return the interval between two dates or times. The function takes three parameters, the interval for the comparison, and the two dates you want to compare.
The following code compares the difference between two dates in years, and the difference between two times in minutes:
<cfoutput>
#dateDiff("yyyy", "12/31/1999", "12/31/2002",)#<br>
#dateDiff("n", "12:00:00", "15:00:00")#
</cfoutput>
This interval can be expressed in a variety of formats:
Datepart Interval s Second n Minute h Hour ww Week w Weekday d Day y Day of year m Month q Quarter yyyy Year
dateDiff() returns the interval in the unit you specify by which the second date/time is greater than the first. If the first date is greater than the second, a negative number is returned.
+