HTML <time> Element
The <time> element represents a specific date, time, or duration. Its datetime attribute can provide a machine-readable value while the element's content presents the information in a format that is easy for people to read.
Syntax
<time datetime="2026-09-14">September 14, 2026</time>
Attributes
The <time> element supports the global HTML attributes and the following element-specific attribute:
| Attribute | Description |
|---|---|
datetime |
Provides a machine-readable representation of the date, time, or duration represented by the element. |
Example
This example uses the <time> element to display a readable event date while the datetime attribute provides the same date in a machine-readable format.
Usage Notes
The <time> element can represent calendar dates, times of day, combined dates and times, time-zone offsets, and durations.
When the text inside the element is already a valid machine-readable value, the datetime attribute may be omitted. When the visible text uses a more reader-friendly format, use datetime to provide the machine-readable value.
The <time> element does not automatically format, calculate, or display a clock. It adds semantic meaning to date and time information already included in the document.
Accessibility
Write the visible date or time in a clear format that users can easily understand. The datetime attribute provides structured information for software, but it should not be used as a substitute for understandable visible text.
Browser Support
Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.
For detailed browser compatibility information, see Can I Use: HTML <time> Element .
Related Elements
The <time> element can be used with other semantic elements, including <article>, <p>, and <span>, when dates or times appear within document content.
Specifications
The <time> element is defined in the WHATWG HTML Living Standard .
