You are viewing documentation for v1.0.x. Change

distanceOfTimeInWords()

Description

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

Function Syntax

distanceOfTimeInWords(fromTime, toTime [, includeSeconds ])

Parameters

Parameter 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.

Examples

<cfset aWhileAgo = Now() - 30>
    <cfset rightNow = Now()>
    <cfoutput>#distanceOfTimeInWords(aWhileAgo, rightNow)#</cfoutput>