Return to v2.5.0 docs

timeAgoInWords()


Global Helpers Date Functions any controller model test migrator migration tabledefinition


Returns a string describing the approximate time difference between the date passed in and the current date.

Name 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.
// Controller code.
aWhileAgo = DateAdd("d", -90, Now());

// View code.
<!--- Will output: 3 months --->
#timeAgoInWords(aWhileAgo)#

Related Functions

Date Functions