Lesson 48 of 55 · HTML
The `<time>` Element – Machine‑readable Dates & Times
Duration: 8 min
The <time> Element – Semantic Dates & Times
<time> marks dates, times, or durations in a machine‑readable format.
<p>Event starts on <time datetime='2026-09-15T19:30' pubdate>September 15, 2026 at 7:30 PM</time>.</p>
<p>The conference lasted <time datetime='PT8H'>8 hours</time>.</p>
Attributes
datetime– ISO 8601 string that browsers and search engines can parse.pubdate– Legacy attribute indicating a publication date; modern SEO prefers structured data instead.title– Optional tooltip for human readers.
Use cases
- Blog post timestamps for SEO and readability.
- Event dates for rich snippets (
Eventschema). - Durations (
PT5Mfor five minutes) for podcasts or video length. - Micro‑blogging with RFC 3339 compliant dates.
Quick checklist for <time>
datetimeattribute present and ISO‑8601 compliant? ✅- Human‑readable text provided inside the element? ✅
- Used for publish dates, event dates, or durations? ✅
- No reliance on
pubdatealone for SEO (use JSON‑LD instead)? ✅ - Tested with search engine structured‑data tools? ✅
Tip: When publishing news articles, combine
<time>with JSON‑LDArticleschema for maximum SEO benefit.