HTML Time Tag

The HTML <time> tag is used to represent dates and times in a machine-readable format. It helps browsers, search engines, and assistive technologies understand time-related data clearly. It is commonly used for events, blog posts, schedules, and timestamps.

3 views
5 min read
Try It Yourself

Experiment with the code in an interactive editor

What is Time Tag?

The <time> tag tells browsers and search engines that this text is a date or time.

Why use it? Google can understand and use dates for search results, calendars, and schedules.

Examples:

1<!-- Simple date -->
2<p>Published on <time datetime="2026-04-07">April 7, 2026</time></p>
3
4<!-- Time only -->
5<p>Meeting starts at <time datetime="14:30">2:30 PM</time></p>
6
7<!-- Date and time together -->
8<p>Event: <time datetime="2026-12-25T10:00">Christmas morning at 10 AM</time></p>
9
10<!-- Date range -->
11<p>Project duration: <time datetime="2026-01-01">Jan 1</time> to <time datetime="2026-12-31">Dec 31, 2026</time></p>
12
13<!-- Machine readable, human friendly display -->
14<p>Independence Day: <time datetime="1947-08-15">15th August, 1947</time></p>

datetime format explained:

Format

Example

What it means

YYYY-MM-DD

2026-04-07

April 7, 2026

HH:MM

14:30

2:30 PM

YYYY-MM-DDTHH:MM

2026-12-25T10:00

Dec 25, 2026 at 10:00 AM

Why use

  • Search engines understand dates

  • Can be used for calendars and schedules

  • Better for screen readers

  • Browsers can offer date pickers