HTML <time> datetime Attribute
Example
<p>The program starts at <time datetime="2021-01-01T01:00:00">01:00</time>.</p>
Meaning
The datetime attribute is used to indicate the date and time of the enclosed content.
The value of the attribute is a date in a special format as defined by ISO 8601.
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 |
Standard Syntax
<time datetime="YYYY-MM-DDThh:mm:ssTZD|PTDHMS">...</time>
Advertisement
Attribute Values
| Value | Description |
|---|---|
| YYYY-MM-DDThh:mm:ssTZD PTDHMS |
Date and time of when the text was deleted.
Components:
|