Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

HTML <del> datetime Attribute

The datetime attribute on a <del> tag attaches a deletion datetime.

This value is not visible, but it is machine-readable.

Example

#

A <del> element with a datetime attribute.
The datetime value signifies when the deletion occurred.

Your order has been canceled cancelled.

<p>
  Your order has been 
  <del datetime="2020-11-25T09:10:43">canceled</del> 
  cancelled.
</p>

Using datetime

The datetime attribute attaches a date (required) and time (optional) value to a del element.

Its value is not visible to the user; it only adds a semantic timestamp to the element.

The datetime values are readable by screen readers, search engines, JavaScript code, and others.


Syntax

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

Values

#

VALUE: YYYY-MM-DDThh:mm:ssTZD
DESCRIPTION: The date and time attached to the element.
The format can be broken down as follows:
  • YYYY - year (e.g. 2020)
  • MM - month (e.g. 09 for September)
  • DD - day (e.g. 01 for first day of the month)
  • T or space - a date and time separator, required if date is included
  • hh - hour in 24-hour format (e.g. 23)
  • mm - minutes
  • ss - seconds
  • TZD - Time zone designator where Z refers to Zulu or GMT
  • P - prefix for period (duration)
  • D - prefix for days
  • H - prefix for hours
  • M - prefix for minutes
  • S - prefix for seconds
EXAMPLES: local time
2021-01-18 11:54:41.809
international time
2021-01-18 18:54:41.809Z
duration
PD18H23M40

Browser support

Here is when datetime support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <del>
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

Guides