<time>: The TIME Element

Last updated: 2026-10-13

<time>The TIME Element

Represents a machine-readable date or time, helping search engines and scripts parse it precisely.

CategorySemantic
Content ModelPhrasing content
Allowed ParentsAny element that accepts flow content
Content TagYes — requires closing </time> tag
StatusStandard

📝 Syntax

<time datetime="2026-08-23">Aug 23, 2026</time>

⚙️ Attributes

This element supports the global attributes plus the following:

AttributeValueDescription
datetimeMachine-readable date/time, e.g. 2026-08-23T13:30.

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
<time> ✓ v1 ✓ v12 ✓ v1 ✓ v1 ✓ v1
Supported in all major browsers
Tip: Put a standard value in datetime (e.g. 2026-08-23 or 2026-08-23T13:30); the visible text can be anything.

❓ FAQ

QWhat is the time tag for?
A<time> pairs a human-readable label with a machine-readable datetime attribute. For example <time datetime='2026-10-09'>today</time> — browsers, search engines, and calendar tools can all parse it precisely, which helps SEO for article publication dates.
QWhat format does the datetime attribute take?
AValid formats include the date 2026-10-09, date plus time 2026-10-09T14:30, with timezone 2026-10-09T14:30+08:00, the year 2026, and durations PT2H30M — all ISO 8601. Without a datetime attribute, the tag content itself must be machine-readable.
QCan time mark a duration?
AYes, using the ISO 8601 duration format: <time datetime='PT2H30M'>two and a half hours</time> means 2 hours 30 minutes; the value starts with P (Period). Great for course lengths, video durations, and similar cases.
More case studies coming soon — check back later.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏