Global Helpers
timeUntilInWords()
Signature
Section titled “Signature”timeUntilInWords() — returns string
Available in: controller, model, migrator, migration, tabledefinition
Category: Date Functions
Description
Section titled “Description”Returns a string describing the approximate time difference between the current date and the date passed in.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
toTime | date | yes | — | Date to compare to. |
includeSeconds | boolean | no | false | Whether or not to include the number of seconds in the returned string. |
fromTime | date | no | [runtime expression] | Date to compare from. |
Examples
Section titled “Examples”// Controller code.
aLittleAhead = DateAdd("d", 365, Now());
// View code.
<!--- Will output: about 1 year --->
#timeUntilInWords(aLittleAhead)#