HTML datetime Attribute
Example
<p>This text has been <del datetime="2020-01-01T01:01:01Z">deleted</del>.</p>
Meaning
The date and time the deletion, insertion or enclosed content was made.
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
<element datetime="YYYY-MM-DDThh:mm:ssTZD">
Browser Support
Status
Applies to:
The datetime attribute can be used on the following element:
Attribute Values
Value | Description |
---|---|
YYYY-MM-DDThh:mm:ssTZD | Date and time of when the text was deleted.
Components:
|
More Examples
Example
<p>Cost of the product has been increased <ins cite="http://www.example.com/index.html" date="2021-01-01T00:00:00-00:00">New rates will be effected January 2021 onwards.</ins></p>
Example
<p>The program starts at <time datetime="2021-01-01T01:00:00">01:00</time>.</p>