Miscellaneous
timeAgoInWords()
Signature
Section titled “Signature”timeAgoInWords() — returns any
Description
Section titled “Description”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.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
fromTime | date | yes | — | Date to compare from.. |
includeSeconds | boolean | yes | false | Whether or not to include the number of seconds in the returned string. |
toTime | date | yes | [runtime expression] | Date to compare to. |
Examples
Section titled “Examples”timeAgoInWords(fromTime [, includeSeconds, toTime ]) <cfset aWhileAgo = Now() - 30> <cfoutput>#timeAgoInWords(aWhileAgo)#</cfoutput>