September 2, 2026
The HTML <time> Element Gives Dates and Times a Machine-Readable Form
It lets human-friendly date text carry a constrained, machine-readable counterpart. It does not convert time zones, create an add-to-calendar control, or make a page eligible for Google's event experience by itself.
A date can be perfectly clear to a person and still be awkward for software. "Next Friday," "09/10/26," and "ten past seven" all depend on language, location, context, or convention. The HTML <time> element gives authors a way to keep readable wording while adding a constrained, machine-readable value.
The short rule
Use <time> when a date, time, time-zone offset, or duration in the text has a useful machine-readable equivalent. Put that value in datetime when the visible wording is not already in one of HTML's permitted formats.
One piece of text, two useful layers
The visible content is for people. The datetime attribute is for user agents, scripts, extractors, and other tools. These two layers can express the same fact in different forms:
<p>
Registration closes
<time datetime="2026-09-18T17:00:00-07:00">
September 18, 2026 at 5:00 p.m. Pacific time
</time>.
</p>
The sentence stays natural; the attribute carries a syntactically valid machine-readable date, time, and UTC offset.
The element has no special visual appearance by default. It does not produce a date picker or a countdown. Its job is semantic: the HTML Living Standard limits its value to defined forms of dates, times, offsets, and durations.
If datetime is omitted, the element's child text content supplies its datetime value. For conforming markup, that text must match one of the permitted syntaxes, and the <time> element must not have element descendants:
<time>2026-09-18</time><!-- valid date value --><time>September 18, 2026</time><!-- not a valid datetime value -->
For ordinary prose, an explicit datetime attribute is usually clearer. It allows the visible text to follow the reader's language and style while the underlying value follows HTML's syntax.
What belongs in datetime
The HTML Standard accepts more than full timestamps. A <time> value can be a valid month, date, yearless date, time, local date and time, time-zone offset, global date and time, week, year, or fixed-length duration string.
Calendar date
Visible text: September 18, 2026
Datetime value: 2026-09-18
Local date and time with no offset
Visible text: September 18, 2026 at 9 a.m. at the venue
Datetime value: 2026-09-18T09:00
Global date and time with a fixed offset
Visible text: September 18, 2026 at 5 p.m. Pacific time
Datetime value: 2026-09-18T17:00:00-07:00
Duration
Visible text: 90 minutes
Datetime value: PT1H30M
Calendar week
Visible text: Week 38 of 2026
Datetime value: 2026-W38
In HTML's terminology, "local date and time" means the value contains no time-zone offset; it does not make the browser interpret the value in the reader's time zone. HTML durations represent fixed numbers of seconds. Months and years are not valid duration components because their lengths vary.
Values such as September 18, 09/18/26, 5pm PDT, or next Friday do not match any permitted datetime syntax merely because they are placed in the attribute. The syntax is data, not a second prose field.
The time-zone elephant
A numeric offset and a geographic time zone are not the same thing. In the example, -07:00 records the applicable offset from UTC; it does not preserve the IANA zone America/Los_Angeles or that zone's rules. A regional zone can use different offsets across daylight-saving transitions, and governments can change its rules.
For a one-time online meeting that occurs at the same instant worldwide, a global date and time with Z or a numeric offset is useful:
<time datetime="2026-11-05T17:00:00Z">
November 5, 2026 at 5:00 p.m. UTC
</time>
For an event tied to a venue's local clock, keep the venue and regional time zone in the surrounding content and in the system that manages the event. For a future venue event, derive any displayed offset from the regional zone and retain that zone in the event system; rules can change. Do not invent midnight when only the date is known.
What <time> does not do
It does not automatically translate the visible date, adjust it for the reader's location, add the event to a calendar, or preserve a geographic time-zone identifier. Those behaviors require separate application logic, data, or controls.
Keep essential information visible
The semantic value is useful, but it should not become a hiding place for facts people need. If the year, time zone, or duration changes a user's decision, include it in the visible wording. The current W3C HTML Accessibility API Mappings Working Draft maps <time> to the ARIA time role. That describes browser exposure, not a guaranteed spoken presentation in every screen reader, so keep the page understandable from its visible wording alone.
The datetime value must represent the element's visible contents. This example is nonconforming because the dates disagree:
<!-- Nonconforming: both dates are valid strings, but they disagree -->
<time datetime="2026-09-19">September 18, 2026</time>
Readable date wording also needs context. A global audience is better served by "September 18, 2026" than an ambiguous numeric form such as "09/10/26." The machine value cannot repair confusing visible copy.
It is not event structured data by itself
The <time> element can be combined with a structured-data vocabulary, but the element alone does not declare that a page describes an event and does not make the page eligible for Google's event experience.
Google's event documentation describes a separate Event structured-data object with required information such as a name, start date, and qualifying location details. Its date values use ISO 8601. Eligibility still does not guarantee that a rich result will appear.
That distinction matters: use <time> when visible text denotes one of HTML's permitted dates, times, offsets, or durations. Add accurate event structured data only when the page and event meet the applicable requirements. One layer does not replace the other.
Four common mistakes
Putting prose in datetime. Values such as "tomorrow evening" are readable, but do not match a permitted datetime syntax.
Leaving out the offset for a single global instant. A local date-time without an offset does not identify one precise moment worldwide.
Treating an offset as a regional time-zone rule. Store the relevant geographic zone separately when future conversion or recurrence depends on it.
Promising a search feature. The <time> element alone neither makes a page eligible for Google's event experience nor guarantees that any search feature will appear.
A practical publishing check
Is the visible date unambiguous to the intended audience?
Does datetime use one of the HTML Standard's permitted syntaxes?
Does the datetime value represent the element's visible contents?
Is Z or a numeric time-zone offset included when the value must identify one global instant?
Is the geographic time zone stored elsewhere when regional rules matter?
Are unknown times left unknown instead of being filled with a false midnight?
Has the finished markup been checked with an HTML validator?
Small semantic elements rarely transform a page on their own. Their value is quieter: they let human language and software-readable data coexist without forcing either one to impersonate the other. For dates, times, and durations, that is exactly the work <time> is designed to do.
Primary and official sources
WHATWG HTML Living Standard: the time element
WHATWG HTML Living Standard: date, time, and duration microsyntaxes
W3C HTML Accessibility API Mappings 1.0 Working Draft: time
Google Search Central: Event structured data
Nu HTML Checker