Return to v1.4.5 docs

distanceOfTimeInWords()



Pass in two dates to this method, and it will return a string describing the difference between them.

Name Type Required Default Description
fromTime date Yes Date to compare from..
toTime date Yes , Date to compare to.
includeSeconds boolean No false Whether or not to include the number of seconds in the returned string.
distanceOfTimeInWords(fromTime, toTime [, includeSeconds ]) <cfset aWhileAgo = Now() - 30>
<cfset rightNow = Now()>
<cfoutput>#distanceOfTimeInWords(aWhileAgo, rightNow)#</cfoutput>