1. Docs
  2. Formulas
  3. Functions

DISTANCE_OF_TIME_IN_WORDS

Returns the distance between two times in words for the provided date/time. Defaults to the current time if "from" is unspecified.

Under 90 seconds, the result is one of: "less than 5 seconds" (zero to four seconds), "less than 10 seconds" (five to nine seconds), "less than 20 seconds" (10 to 19 seconds), "half a minute" (20 to 39 seconds), "less than a minute" (40 to 59 seconds), or "1 minute" (60 to 89 seconds).

Categories: Dates/Times

Syntax

DISTANCE_OF_TIME_IN_WORDS(date, [from])

Examples

Example 1

Input

1
{
2
"my_action": {
3
"in_the_past": "2022-03-19T17:49:01+0000"
4
}
5
}

Formula

DISTANCE_OF_TIME_IN_WORDS(my_action.in_the_past)

Output

"over 1 year ago"

Example 2

Input

1
{
2
"my_action": {
3
"in_future": "2023-11-19T17:49:01+0000"
4
}
5
}

Formula

DISTANCE_OF_TIME_IN_WORDS(my_action.in_future)

Output

"in 24 days"

Example 3

Input

1
{
2
"my_action": {
3
"from_in_future": "2024-02-01T17:01:01+0000"
4
}
5
}

Formula

DISTANCE_OF_TIME_IN_WORDS('2024-02-01T20:31:01+0000', my_action.from_in_future)

Output

"in about 4 hours"

Sample actions

Event Transform
my action
Event Transform
DISTANCE_OF_TIME_IN_WORDS

Select an action to inspect

You can also click "Copy actions" and paste them in your Tines story to see how they work.

Was this helpful?