Skip to content

Miscellaneous

timeAgoInWords()

timeAgoInWords() — returns any

Pass in a date to this method, and it will return a string describing the approximate time difference between that date and the current date.

NameTypeRequiredDefaultDescription
fromTimedateyesDate to compare from..
includeSecondsbooleanyesfalseWhether or not to include the number of seconds in the returned string.
toTimedateyes[runtime expression]Date to compare to.
timeAgoInWords(fromTime [, includeSeconds, toTime ]) <cfset aWhileAgo = Now() - 30>
<cfoutput>#timeAgoInWords(aWhileAgo)#</cfoutput>