HTML | datetime Attribute
The HTML datetime Attribute is used to specify the date and time of the inserted and the deleted text. It also represents the date and time of the <time> element.
Syntax:
<element datetime="YYYY-MM-DDThh:mm:ssTZD">
Applicable: datetime attribute is applicable for:
Example: This Example illustrates the use of datetime attribute.
<!DOCTYPE html> <html> <head> <title> HTML datetime Attribute </title> <style> del { color: red; } ins { color: green; } h1 { color: green; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2> HTML datetime Attribute </h2> <p>GeeksforGeeks is a <del>mathematical</del> <!-- Assigning id to 'ins' tag --> <ins id="GFG" datetime="2018-11-21T15:55:03Z"> computer </ins> <time datetime="2017-02-14 20:00"> scienceportal </time> </p> </body> </html> |
Output:

Supported Browsers: The browsers supported by datetime Attribute are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | <del> datetime Attribute
- HTML | <ins> datetime Attribute
- HTML | <time> datetime Attribute
- HTML | DOM ins dateTime Property
- HTML | DOM del dateTime Property
- HTML | DOM Input Datetime name Property
- HTML | DOM Input Datetime value Property
- HTML | DOM Input Datetime max Property
- HTML | DOM Time dateTime Property
- HTML | DOM Input Datetime min Property
- HTML | DOM Input Datetime Object
- HTML | DOM Input Datetime disabled Property
- HTML | DOM Input Datetime autocomplete Property
- HTML | DOM Input Datetime defaultValue Property
- HTML | DOM Input Datetime form Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


