Horje
HTML datetime Attribute

Definition and Usage

The datetime attribute specifies the date and time when the text was deleted/inserted.

When used together with the <time> element, it represents a date and/or time of the <time> element.


Applies to

The datetime attribute can be used on the following elements:

Elements Attribute
<del> datetime
<ins> datetime
<time> datetime

Browser Support

The datetime attribute has the following browser support for each element.


How to add A deleted text with a date and time of when the text was deleted

The del datetime attribute.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The del datetime attribute</h1>

<p><del datetime="2015-11-15T22:55:03Z">This text has been deleted</del></p>

</body>
</html>

Output should be:

How to add A deleted text with a date and time of when the text was deleted

How to add An inserted text with a date and time of when the text was inserted

The ins datetime attribute

This is a text. This is an inserted text.

Note: The datetime attribute does not render as anything special in any of the major browsers.

index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The ins datetime attribute</h1>

<p>This is a text. <ins datetime="2015-09-15T22:55:03Z">This is an inserted text.</ins></p>

<p><b>Note:</b> The datetime attribute does not render as anything special in any of the major browsers.</p>

</body>
</html>

Output should be:

How to add An inserted text with a date and time of when the text was inserted

How to add A time element with a machine-readable datetime attribute

The time datetime attribute

I have a date on Valentines day.

Note: The time element does not render as anything special in any of the major browsers.

index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The time datetime attribute</h1>

<p>I have a date on <time datetime="2017-02-14 20:00">Valentines day</time>.</p>

<p><b>Note:</b> The time element does not render as anything special in any of the major browsers.</p>

</body>
</html>

Output should be:

How to add A time element with a machine-readable datetime attribute




html datetime attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference