CSS Portal

HTML <time> Tag

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The <time> element in HTML represents a specific point in time or a period of time. It is designed to mark up dates, times, durations, or other temporal data in a machine-readable way while still being meaningful to human readers. This makes it particularly useful for events, deadlines, schedules, timestamps on blog posts, or any content that has a temporal context.

Unlike plain text, which can be ambiguous or difficult for computers to interpret, the <time> element allows the inclusion of a standardized datetime value (in ISO 8601 format), which can be easily parsed by web applications, search engines, or assistive technologies. This structured data can improve accessibility, enable automated calendar integrations, and enhance search engine understanding of your content.

The <time> element can represent:

  • Specific dates (e.g., <time datetime="2025-12-31">December 31, 2025</time>)
  • Specific times (e.g., <time datetime="2025-12-26T15:30">3:30 PM on December 26, 2025</time>)
  • Durations (e.g., <time datetime="PT2H30M">2 hours and 30 minutes</time>)
  • Date ranges or periods (e.g., <time datetime="2025-01-01/2025-12-31">Year 2025</time>)

The content inside the <time> element is visible to users and can be written in a human-readable format, while the datetime value provides a standardized machine-readable format. This dual purpose ensures both clarity for readers and usability for programs or automated systems.

In practice, the <time> element helps improve semantic structure and makes time-related information more meaningful and actionable on the web.

Properties

Permitted Parents
Any element that accepts phrasing content
Content
Inline and text, but no descendant <time> elements
Start/End Tags
Start tag: required, End tag: required

Example

<p>Our business hours are <time>8:30</time> until <time>4:30</time></p>
<p>My holidays start on <time datetime="2018-12-25 00:00">Christmas day</time>.</p>

Attributes

datetime
Gives the date/time being specified. Otherwise, the date/time is given by the element's contents.

Global Attributes

The <time> tag also supports the Global Attributes in HTML5

Event Attributes

The <time> tag also supports the Event Attributes in HTML5

Browser Support

The following information will show you the current browser support for the HTML <time> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 26th December 2025

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!