---
title: DISTANCE_OF_TIME_IN_WORDS
url: https://www.tines.com/docs/formulas/functions/distance-of-time-in-words/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/docs/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# DISTANCE_OF_TIME_IN_WORDS

*[View on tines.com](https://www.tines.com/docs/formulas/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.
Distances for seconds below 1 minute and 29 seconds are reported based on the following table:

0-4   secs      # => less than 5 seconds
5-9   secs      # => less than 10 seconds
10-19 secs      # => less than 20 seconds
20-39 secs      # => half a minute
40-59 secs      # => less than a minute
60-89 secs      # => 1 minute

**Categories:** Dates/Times

## Syntax

```
DISTANCE_OF_TIME_IN_WORDS(date, [from])
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "in_the_past": "2022-03-19T17:49:01+0000"
  }
}
```

Formula:

```
DISTANCE_OF_TIME_IN_WORDS(my_action.in_the_past)
```

Output:

```json
"over 1 year ago"
```

### Example 2

Input:

```json
{
  "my_action": {
    "in_future": "2023-11-19T17:49:01+0000"
  }
}
```

Formula:

```
DISTANCE_OF_TIME_IN_WORDS(my_action.in_future)
```

Output:

```json
"in 24 days"
```

### Example 3

Input:

```json
{
  "my_action": {
    "from_in_future": "2024-02-01T17:01:01+0000"
  }
}
```

Formula:

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

Output:

```json
"in about 4 hours"
```

## Sample actions

```json
{
  "standardLibVersion": "37",
  "actionRuntimeVersion": "4",
  "agents": [
    {
      "disabled": false,
      "name": "my action",
      "description": null,
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "in_the_past": "2022-03-19T17:49:01+0000",
          "in_future": "2023-11-19T17:49:01+0000"
        }
      },
      "position": {
        "x": -150,
        "y": 150
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "recordType": null,
      "recordWriters": [],
      "form": null,
      "cardIconName": null,
      "createdFromTemplateGuid": null,
      "createdFromTemplateVersion": null,
      "originStoryIdentifier": "kes-test:779db79df723796bdf6e92d1f6bfc714"
    },
    {
      "disabled": false,
      "name": "DISTANCE_OF_TIME_IN_WORDS",
      "description": null,
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "in_the_past": "=DISTANCE_OF_TIME_IN_WORDS(my_action.in_the_past)",
          "in_future": "<<DISTANCE_OF_TIME_IN_WORDS(my_action.in_future)>>",
          "in_future_relative_to_2024": "<<DISTANCE_OF_TIME_IN_WORDS(\"2024-02-01T15:01:01+0000\", \"2024-01-01T15:01:01+0000\")>>",
          "in_future_relative_to_2024_in_hours": "<<DISTANCE_OF_TIME_IN_WORDS(\"2024-02-01T20:31:01+0000\", \"2024-02-01T17:01:01+0000\")>>"
        }
      },
      "position": {
        "x": -150,
        "y": 240
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "recordType": null,
      "recordWriters": [],
      "form": null,
      "cardIconName": null,
      "createdFromTemplateGuid": null,
      "createdFromTemplateVersion": null,
      "originStoryIdentifier": "kes-test:779db79df723796bdf6e92d1f6bfc714"
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
