The
<time>tag defines a specific time or date, or both.
It helps browsers, search engines, and assistive technologies understand the time-related data in a machine-readable format using thedatetimeattribute.This element is especially useful for events, schedules, articles, or timestamps in blog posts.
Syntax
<time datetime="YYYY-MM-DDThh:mm:ssTZD">Visible Time or Date</time>Attributes
| Attribute | Description |
|---|---|
| datetime | Specifies the date and/or time in a machine-readable format (e.g., 2025-11-01T10:00). |
| id | Defines a unique identifier for the element. |
| class | Defines one or more class names for CSS styling. |
| style | Applies inline CSS styles. |
💡 Note: The
datetimeattribute helps search engines understand structured data, improving SEO.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Time Tag Example</title>
</head>
<body>
<h1>HTML <time> Tag Example</h1>
<p>The seminar will start at <time datetime="2025-11-05T14:00">2:00 PM, November 5, 2025</time>.</p>
</body>
</html>Output
Browser Output
The visible text will be displayed as:
“2:00 PM, November 5, 2025”
However, browsers and search engines can read the datetime attribute as machine-readable information.
You can try this in our TryIt Editor to view the output and inspect the HTML for structured data.
Browser Support
Chrome | Firefox | Edge | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| ✅Yes | ✅Yes | ✅Yes | ✅Yes | ✅Yes | ✅Yes |
All browsers support this <time> tag, but IE has limited support for this.
Notes
- The
<time>tag does not change how text looks by default. - It allows search engines and other applications to extract and understand time-based information.
- Always use ISO 8601 format for the
datetimeattribute (e.g.,2025-11-01T09:30). - The tag improves SEO and accessibility for date and time content.
Conclusion
The <time> tag is a semantic and SEO-friendly way to represent dates and times.
It makes your web content more meaningful for both users and search engines, especially for event-based or time-sensitive information.