HTML datetime duration
======================

July 13, 2024
https://stefan.vanburen.xyz/til/html-date-duration/


Last week I learned that an <abbr title="HyperText Markup Language">HTML</abbr> `datetime` attribute can [represent a duration][valid-datetime-values].

For example:

```html
<time datetime="PT4H18M3S">
  4 hours, 18 minutes and 3 seconds
</time>
```

The syntax is an [<abbr title="International Organization for Standardization">ISO</abbr> 8601 Duration](https://en.wikipedia.org/wiki/ISO_8601#Durations).

[valid-datetime-values]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time#valid_datetime_values
