HTML <time> tag

Definition and Usage

<time> The tag defines a specific time (or date and time).

The datetime attribute of this element is used to convert time into a machine-readable format, so that browsers can provide date reminders through the user's calendar and search engines can generate more intelligent search results.

See also:

HTML DOM Reference Manual:Time Object

Example

How to define time and date:

<p>Business Hours: Every working day from <time>10:00</time> to <time>21:00</time>.</p>
<p>I have a date on <time datetime="2024-02-14 18:00">Valentine's Day</time>.</p>

Try It Yourself

Attribute

Attribute Value Description
datetime Date and Time Represents the machine-readable format of the <time> element.

Global Attributes

<time> The tag also supports Global Attributes in HTML.

Event Attributes

<time> The tag also supports Event Attributes in HTML.

Default CSS Settings

None.

Browser Support

The numbers in the table indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
62.0 18.0 22.0 7.0 49.0