Open In App

HTML <del> datetime Attribute

Last Updated : 07 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The <del> datetime Attribute in HTML is used to specify the date and time of the deleted text. The date-time is inserted in the format YYYY-MM-DDThh:mm:ssTZD. 
Syntax: 
 

<del datetime="YYYY-MM-DDThh:mm:ssTZD"> 

Attribute Values: This attribute contains single value YYYY-MM-DDThh:mm:ssTZD which is used to specify the date and time when the text was deleted. 
The explanation of datetime components are listed below: 
 

  • YYYY: It sets the year of datetime object (e.g. 2009).
  • MM: It sets the month of datetime object (e.g. 05 for March).
  • DD: It sets the day of the month of datetime object (e.g. 04).
  • T: It is a required separator.
  • hh: It sets the hour of datetime object (e.g. 18 for 06.00pm).
  • mm: It sets the minutes of datetime object (e.g. 34).
  • ss: It sets the seconds of datetime object (e.g. 40).
  • TZD: Time Zone Designator (Z denotes Zulu, also known as Greenwich Mean Time)

Example: 
 

html




<!DOCTYPE html> 
<html
  
<head
    <title
        HTML Del dateTime Attribute 
    </title
      
    <style
        del { 
            color: red; 
        
          
        ins { 
            color: green; 
        
    </style
</head
  
<body style="text-align:center;"
    <h1
    GeeksforGeeks 
</h1
  
    <h2
    HTML <del> dateTime Attribute 
</h2
  
    <p
        GeeksforGeeks is a 
        <del id="GFG" datetime="2018-11-21T15:55:03Z"
            mathematical
        </del>
          
        <ins>computer</ins> science portal 
    </p>
</body
  
</html>                    


Output : 
 

Supported Browsers: The browser supported by HTML <del> dateTime Attribute are listed below: 
 

  • Google Chrome
  • Edge 12
  • Internet Explorer
  • Firefox 1
  • Opera
  • Safari


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads