HTML
Example
How to define a time and date:
<
p
We open for business every morning at
<
time
9:00
timeo'clock.
p
<
p
I am
<
time
datetime
=
"
2016-02-14
"Valentine's Day
time
have a date.
p
Try it »
Browser support
The numbers in the table indicate the version number of the first browser that supports this property.
| Element | |||||
|---|---|---|---|---|---|
| 6.0 | 9.0 | 4.0 | 5.0 | 11.1 |
Tag Definition and Usage Notes
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
property
New: new attribute in HTML5.
| property | Value | Description |
|---|---|---|
| datetimeNew | datetime | Specifies the date/time. Alternatively, the date/time can be given by the content of the element. |
| pubdate | datetime | (This attribute is still being designed and discussed by the WHATWG and W3C organizations.) Indicates |