HTML <time> Tag
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
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
Tablets & Mobile
Last updated by CSSPortal on: 26th December 2025
