Skip to the page
html reference · text

HTML <time> tag

closing tag
required
void element
no
lives inside
inline, inside running text
typically holds
a human-readable date or time

Where it goes

Around the date as the reader sees it, with datetime in the machine form. YYYY-MM-DD for a date. HH:MM for a time. Both joined with a T for date and time.

Example

<p>Published <time datetime="2026-03-03">March 3rd</time>. Doors open at <time datetime="19:30">7:30 pm</time>.</p>

Open this example in the editor →

Common mistakes

  • Skipping datetime when the visible text is vague. "next Friday" inside <time> with no datetime helps no one.
  • Writing datetime in a local style like 03/04/2026. It must be year, month, day, or browsers and search engines ignore it.
  • Using it for anything time-flavored, like "a long time ago." It is for a specific moment or span that can be written as a datetime.

Related

Updated 24 October 2026. Practice it in the html route, or read more on MDN.