Miscellaneous
distanceOfTimeInWords()
Signature
Section titled “Signature”distanceOfTimeInWords() — returns any
Description
Section titled “Description”Pass in two dates to this method, and it will return a string describing the difference between them.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
fromTime | date | yes | — | Date to compare from.. |
toTime | date | yes | , | Date to compare to. |
includeSeconds | boolean | yes | false | Whether or not to include the number of seconds in the returned string. |
Examples
Section titled “Examples”distanceOfTimeInWords(fromTime, toTime [, includeSeconds ]) <cfset aWhileAgo = Now() - 30> <cfset rightNow = Now()> <cfoutput>#distanceOfTimeInWords(aWhileAgo, rightNow)#</cfoutput>