To mark up a date and/or time, place the date and time within the `` tags. The `datetime` attribute provides a machine-readable version of the date and time using the ISO 8601 format (YYYY-MM-DDThh:mm:ssTZD).
Example: Basic `` Tag
<p>The meeting is at <time datetime="2024-03-15T14:30:00">2 PM</time>.</p>
In this example, "2 PM" is displayed to the user, but the browser also has the machine-readable version available which allows it to be used by other applications. The `datetime` attribute is crucial for applications needing to interpret the date and time programmatically.
Browser Support for ``
The `` element is supported by all major modern browsers.
Browser
Version
Chrome
62.0
Edge
18.0
Firefox
22.0
Opera
7.0
Safari
49.0
Attributes of the `` element
Attribute
Value
Description
datetime
YYYY-MM-DDThh:mm:ssTZD
Specifies the date and time in machine-readable format.
The `` element also supports standard HTML global attributes and event attributes.