files/en-us/web/html/reference/elements/time/index.md
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:
{{InteractiveExample("HTML Demo: <time>", "tabbed-shorter")}}
<p>
The Cure will be celebrating their 40th anniversary on
<time datetime="2018-07-07">July 7</time> in London's Hyde Park.
</p>
<p>
The concert starts at <time datetime="20:00">20:00</time> and you'll be able
to enjoy the band for at least <time datetime="PT2H30M">2h 30m</time>.
</p>
time {
font-weight: bold;
}
Like all other HTML elements, this element supports the global attributes.
datetime
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.
<code><em>HH</em>:<em>MM</em>:<em>SS</em></code>
<code><em>HH</em>:<em>MM</em>:<em>SS</em>.<em>mmm</em></code>
</td>
<td>
<code>23:59</code>
<code>12:15:47</code>
<code>12:15:52.998</code>
</td>
</tr>
<tr>
<td>Valid local date and time string</td>
<td>
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em> <em>HH</em>:<em>MM</em></code>
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em> <em>HH</em>:<em>MM</em>:<em>SS</em></code>
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em> <em>HH</em>:<em>MM</em>:<em>SS</em>.<em>mmm</em></code>
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em>T<em>HH</em>:<em>MM</em></code>
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em>T<em>HH</em>:<em>MM</em>:<em>SS</em></code>
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em>T<em>HH</em>:<em>MM</em>:<em>SS</em>.<em>mmm</em></code>
</td>
<td>
<code>2013-12-25 11:12</code>
<code>1972-07-25 13:43:07</code>
<code>1941-03-15 07:06:23.678</code>
<code>2013-12-25T11:12</code>
<code>1972-07-25T13:43:07</code>
<code>1941-03-15T07:06:23.678</code>
</td>
</tr>
<tr>
<td>Valid time-zone offset string</td>
<td>
<code>Z</code>
<code>+<em>HHMM</em></code>
<code>+<em>HH</em>:<em>MM</em></code>
<code>-<em>HHMM</em></code>
<code>-<em>HH</em>:<em>MM</em></code>
</td>
<td>
<code>Z</code>
<code>+0200</code>
<code>+04:30</code>
<code>-0300</code>
<code>-08:00</code>
</td>
</tr>
<tr>
<td>Valid global date and time string</td>
<td style="max-width:12em">
Any combination of a valid local date and time string followed by a
valid time-zone offset string
</td>
<td>
<code>2013-12-25 11:12+0200</code>
<code>1972-07-25 13:43:07+04:30</code>
<code>1941-03-15 07:06:23.678Z</code>
<code>2013-12-25T11:12-08:00</code>
</td>
</tr>
<tr>
<td>Valid week string</td>
<td><code><em>YYYY</em>-W<em>WW</em></code></td>
<td><code>2013-W46</code></td>
</tr>
<tr>
<td>Four or more ASCII digits</td>
<td><code><em>YYYY</em></code></td>
<td><code>2013</code>, <code>0001</code></td>
</tr>
<tr>
<td>Valid duration string</td>
<td>
<code>P<em>d</em>DT<em>h</em>H<em>m</em>M<em>s</em>S</code>
<code>P<em>d</em>DT<em>h</em>H<em>m</em>M<em>s</em>.<em>X</em>S</code>
<code>P<em>d</em>DT<em>h</em>H<em>m</em>M<em>s</em>.<em>XX</em>S</code>
<code>P<em>d</em>DT<em>h</em>H<em>m</em>M<em>s</em>.<em>XXX</em>S</code>
<code>PT<em>h</em>H<em>m</em>M<em>s</em>S</code>
<code>PT<em>h</em>H<em>m</em>M<em>s</em>.<em>X</em>S</code>
<code>PT<em>h</em>H<em>m</em>M<em>s</em>.<em>XX</em>S</code>
<code>PT<em>h</em>H<em>m</em>M<em>s</em>.<em>XXX</em>S</code>
<code><em>w</em>w <em>d</em>d <em>h</em>h <em>m</em>m <em>s</em>s</code>
</td>
<td>
<code>P12DT7H12M13S</code>
<code>P12DT7H12M13.3S</code>
<code>P12DT7H12M13.45S</code>
<code>P12DT7H12M13.455S</code>
<code>PT7H12M13S</code>
<code>PT7H12M13.2S</code>
<code>PT7H12M13.56S</code>
<code>PT7H12M13.999S</code>
<code>7d 5h 24m 13s</code>
</td>
</tr>
<p>The concert starts at <time datetime="2018-07-07T20:00:00">20:00</time>.</p>
{{EmbedLiveSample('Basic_example', 250, 80)}}
datetime example<p>
The concert took place on <time datetime="2001-05-15T19:00">May 15</time>.
</p>
{{EmbedLiveSample('datetime_example', 250, 80)}}
{{Specifications}}
{{Compat}}