HTML <time>Tag
Examples
How to define time and date:
<p>We, every morning,<time>9:00</time>open for business.</p>
<p>I<time datetime="2016-02-14">Valentine's Day</time>have a date.</p>
Try it Yourself »
Browser Support
The numbers in the table specify the first browser version that fully supports the attribute.
| Element | |||||
|---|---|---|---|---|---|
| <time> | 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
Tag Definition and Usage
The <time> tag defines a Gregorian time (24-hour clock) or date, and the time and timezone offset are optional.
This element is able to encode dates and times in a machine-readable way, so that, for example, user agents can add birthday reminders or scheduled events to the user's calendar, and search engines can generate smarter search results.
Differences between HTML 4.01 and HTML5
The <time> tag is a new tag in HTML5.
Attributes
New: New attribute in HTML5.
| Attribute | Value | Description |
|---|---|---|
| datetimeNew | datetime | Specifies the date/time. Alternatively, the date/time is given by the content of the element. |
| pubdate | datetime | (This attribute is still being designed and discussed by the WHATWG and W3C organizations.) Indicates that the date/time in the <time> element is the publication date of the document (or the nearest ancestor <article> element). |
Global Attributes
The <time> tag supportsHTML Global Attributes。
Event Attributes
The <time> tag supportsHTML Event Attributes。
Other Extensions