juniorHTML5

What is the purpose of the <time> tag?

Updated Apr 28, 2026

Short answer

It represents a specific period in time or a date in a machine-readable format.

Deep explanation

By using the datetime attribute, you provide a standardized format (ISO 8601) that search engines and calendar apps can parse, even if the text shown to the user is 'Last Wednesday'.

Real-world example

A blog engine using <time> so Google can accurately show the publish date in search results.

Common mistakes

  • Putting non-date text inside the datetime attribute.

Follow-up questions

  • Does <time> have to include the year?

More HTML5 interview questions

View all →