timeAgoInWords()
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.
Function Syntax
timeAgoInWords(fromTime [, includeSeconds, toTime ])
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
fromTime |
date |
Yes | |
Date to compare from. |
includeSeconds |
boolean |
No | false |
Whether or not to include the number of seconds in the returned string. |
toTime |
date |
No | [runtime expression] |
Date to compare to. |
Examples
<cfset aWhileAgo = Now() - 30>
<cfoutput>#timeAgoInWords(aWhileAgo)#</cfoutput>
