HTML Guide for time-datetime
The <time> HTML element represents a specific period in time, which can be taken from the datetime attribute or from the text contents of the element.
In both cases, the time or datetime must be in a valid format, for example:
- a valid year string
-
2011
- a valid month string
-
2011-11
- a valid date string
-
2011-11-18
- a valid yearless date string
-
11-18
- a valid week string
-
2011-W47
- a valid time string
-
14:54
14:54:39
14:54:39.929
- a valid local date and time string
-
2011-11-18T14:54:39.929
2011-11-18 14:54:39.929
- a valid global date and time string
-
2011-11-18T14:54:39.929Z
2011-11-18T14:54:39.929-0400
2011-11-18T14:54:39.929-04:00
2011-11-18 14:54:39.929Z
2011-11-18 14:54:39.929-0400
2011-11-18 14:54:39.929-04:00
- a valid duration string
-
PT4H18M3S
For example:
<p>
The event will take place on <time datetime="2025-03-20T13:00">March 20, 2025</time>.
</p>