<time>
HTML <time> (Time) Tag
Example
<p>The program starts at <time datetime="2021-01-01T01:00:00">01:00</time>.</p>
Meaning
The <time> element encloses content that represents a date and/or time.
This element should contain content that is in the correct format unless the datetime attribute is used.
Valid datetime Values:
| Possible | Values |
|---|---|
| a valid year string | 2011 |
| a valid month string | 2011-11 |
| a valid date string | 2011-11-18 |
| a valid yearless date string | 11-18 |
| a valid week string | 2011-W47 |
| a valid time string |
|
| a valid local date and time string |
|
| a valid global date and time string |
|
| a valid duration string | PT4H18M3S |
Version: HTML 5
Standard Syntax
<time datetime="dateTime">...</time>
Advertisement
Attributes
| Attribute | Value | Description |
|---|---|---|
| datetime | dateTime | Specifies the date or time that the element represents. |
| pubdate | pubdate | Specifies that the date and time given by this element should be applied as the publication date of an enclosing <article> element. |
Global Attributes
The <time> element also supports the Global Attributes in HTML.
Event Attributes
The <time> element also supports the Event Attributes in HTML.
By Default CSS Value(s)
None.
Related Tags:
<a>,<abbr>,<b>,<bdi>,<bdo>,<br>,<cite>,<code>,<data>,<dfn>,<em>,<i>,<kbd>,<mark>,<q>,<rp>,<rt>,<ruby>,<s>,<samp>,<small>,<span>,<strong>,<sub>,<sup>,<u>,<var> and<wbr>