# Dates with <time> in Confluence storage format

URL: https://goingstellar.ro/reference/confluence-storage-format/dates/

Dates are written as time elements with a datetime attribute in YYYY-MM-DD form. Confluence renders the text in its own format and adds a class that describes the distance from today. In ADF the same date is a node with a millisecond timestamp.

## Storage format

```xml
<time datetime="2026-12-15" />
```

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
ADF:{"content": [{"content": [{"attrs": {"timestamp": "1796083200000"}, "type": "date"}], "type": "paragraph"}], "type": "doc", "version": 1}
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "paragraph",
   "content": [
    {
     "type": "date",
     "attrs": {
      "timestamp": "1796083200000"
     }
    }
   ]
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<p><time datetime="2026-12-15" /></p>
```

A date inside a paragraph, written as a self-closing time element with an ISO date.

Rendered view (HTML):

```html
<p><time datetime="2026-12-15" class="date-future">15 Dec 2026</time></p>
```

Storage format after the round trip through ADF:

```xml
<p><time datetime="2026-12-15" /></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"content": [{"attrs": {"timestamp": "1796083200000"}, "type": "date"}], "type": "paragraph"}], "type": "doc", "version": 1}
```

A date created from ADF, which uses a millisecond timestamp instead of a text date.

Rendered view (HTML):

```html
<p><time datetime="2026-12-01" class="date-upcoming">01 Dec 2026</time></p>
```

Storage format after the round trip through ADF:

```xml
<p><time datetime="2026-12-01" /></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:task-list><ac:task><ac:task-status>incomplete</ac:task-status><ac:task-body>Call back <time datetime="2026-12-15" /></ac:task-body></ac:task></ac:task-list>
```

A date inside the text of a task, for a deadline next to a to-do.

Rendered view (HTML):

```html
<ul class="inline-task-list" data-inline-tasks-content-id="<page id>"><li data-inline-task-id="">Call back <time datetime="2026-12-15" class="date-future">15 Dec 2026</time></li></ul>
```

Storage format after the round trip through ADF:

```xml
<ac:task-list>
<ac:task>
<ac:task-id>3</ac:task-id>
<ac:task-uuid><id></ac:task-uuid>
<ac:task-status>incomplete</ac:task-status>
<ac:task-body><span class="placeholder-inline-tasks">Call back <time datetime="2026-12-15" /></span></ac:task-body>
</ac:task>
</ac:task-list>
```

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- The datetime value is kept as written. The element stays self-closing, with no text inside it in storage.
- The rendered text is not stored. The view shows 15 Dec 2026 with the class date-future, and 01 Dec 2026 with the class date-upcoming.
- An ADF timestamp of 1796083200000 (midnight UTC) is written as datetime="2026-12-01", and the date 2026-12-15 maps to the timestamp 1797292800000.
- Inside a task, the date survives the round trip, while the task body gets a span with class placeholder-inline-tasks and an id and uuid added.

## Pitfalls

- Write dates as YYYY-MM-DD. The datetime attribute is the only date value stored, and the displayed text is produced when the page is rendered.
- The class on the rendered element is chosen by Confluence and is not stored. Do not use it as a data field.
- Compare dates by the datetime value, not by the rendered text.

## Questions and answers

### Does the documentation describe the time element?

The storage format page does not. The behaviour on this page comes from saving and reading back pages.

## Related

- [<ac:task-list> task lists](https://goingstellar.ro/reference/confluence-storage-format/task-lists/)
- [status macro](https://goingstellar.ro/reference/confluence-storage-format/status/)
- [Storage format vs ADF](https://goingstellar.ro/reference/confluence-storage-format/storage-vs-adf/)
- [Placeholders and template variables](https://goingstellar.ro/reference/confluence-storage-format/placeholders-variables/)

## Sources

- [Atlassian Document Format: document structure (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)
- [Confluence Cloud REST API v1: content (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/)

