The <time>
HTML element represents a specific period in time. It may include the datetime
attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders.
It may represent one of the following:
Like all other HTML elements, this element supports the global attributes.
datetime
-
This attribute indicates the time and/or date of the element and must be in one of the formats described below.
This element is for presenting dates and times in a machine-readable format. For example, this can help a user agent offer to add an event to a user's calendar.
This element should not be used for dates prior to the introduction of the Gregorian calendar (due to complications in calculating those dates).
The datetime value (the machine-readable value of the datetime) is the value of the element's datetime
attribute, which must be in the proper format (see below). If the element does not have a datetime
attribute, it must not have any element descendants, and the datetime value is the element's child text content.
HTML
<p>The concert starts at <time datetime="2018-07-07T20:00:00">20:00</time>.</p>
Result
HTML
<p>
The concert took place on <time datetime="2001-05-15T19:00">May 15</time>.
</p>
Result