# Date element

Displays a date and time formatted for each reader, in their language and timezone.

| | |
|---|---|
| **Available in** | Messages, Modals, Home tab |
| **Used in** | [Rich text section element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-section-element), [Rich text list element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-list-element), [Rich text quote element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-quote-element) |

## Usage

`format` is a template: plain text with tokens in curly braces that are replaced with parts of `timestamp`.

- `{date_num}` — 2026-10-12
- `{date}` — October 12, 2026
- `{date_short}` — Oct 12, 2026
- `{date_long}` — Monday, October 12, 2026
- `{date_pretty}`, `{date_short_pretty}`, `{date_long_pretty}` — today, yesterday or tomorrow when that applies, otherwise like `{date}`, `{date_short}` and `{date_long}`
- `{day_divider_pretty}` — today, yesterday or tomorrow, otherwise the weekday and date without the year (Monday, October 12)
- `{time}` — 2:00 PM (or 14:00, depending on the reader's locale)
- `{time_secs}` — 2:00:00 PM
- `{ago}` — a relative time such as 3 minutes ago or in 2 days

## Fields

| Field | Type | Description | Required? |
|---|---|---|---|
| `type` | String | The type of object; in this case, `date`. | Required |
| `timestamp` | Number | A Unix timestamp, in seconds, of the date to show. | Required |
| `format` | String | A template string with curly-brace tokens to substitute with `timestamp`. See the tokens above. | Required |
| `timezone` | String | The timezone the date is in. | Optional |
| `url` | String | A URL to link the whole formatted date to. | Optional |
| `fallback` | String | Text shown where the date can't be formatted — in search results, notifications and previews. Include the timezone. | Optional |
| `style` | Object | An object of optional boolean properties that dictate style: `bold`, `italic`, `strike`, `highlight`, `client_highlight`, `underline` and `unlink`. | Optional |

> **How Repzo Chat differs from Slack**
>
> - Dates always use the reader's own timezone; `timezone` is ignored.
> - Dates always include the year and day numbers have no ordinal suffix. `{date_slash}` and `{date_long_full}` aren't supported and stay as written, like any unknown token.
> - `url` and `style` are ignored.
> - Without `format`, the `fallback` is shown (or the time in UTC when there's no fallback).

## Examples

### A meeting time

```json
{
  "blocks": [
    {
      "type": "rich_text",
      "elements": [
        {
          "type": "rich_text_section",
          "elements": [
            {
              "type": "text",
              "text": "Contract review with Northwind Trading: "
            },
            {
              "type": "date",
              "timestamp": 1793698200,
              "format": "{date_long_pretty} at {time}",
              "fallback": "Tuesday, November 3, 2026 at 9:30 AM UTC"
            }
          ]
        }
      ]
    }
  ]
}
```

### A relative time

```json
{
  "blocks": [
    {
      "type": "rich_text",
      "elements": [
        {
          "type": "rich_text_section",
          "elements": [
            {
              "type": "text",
              "text": "Last synced with the ERP "
            },
            {
              "type": "date",
              "timestamp": 1791813600,
              "format": "{ago}",
              "fallback": "Oct 12, 2026 2:00 PM UTC"
            }
          ]
        }
      ]
    }
  ]
}
```

## Related

- [Rich text elements](https://workstation.repzo.com/docs/developers/block-kit/rich-text)
- [Block Kit overview](https://workstation.repzo.com/docs/developers/block-kit)
