Skip to content

Global Helpers

timeAgoInWords()

timeAgoInWords() — returns any

Available in: controller, model, migrator Category: Date Functions

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

NameTypeRequiredDefaultDescription
fromTimedateyesDate to compare from.
includeSecondsbooleannofalseWhether or not to include the number of seconds in the returned string.
toTimedateno[runtime expression]Date to compare to.
// Controller code.
aWhileAgo = DateAdd("d", -90, Now());

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