time Tag in HTML


How to define a time and a date:

<p>Open from <time>10:00</time> to <time>21:00</time> every weekday.</p>

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

Definition and Usage

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

The datetime attribute of this element is used translate the time into a machine-readable format so that browsers can offer to add date reminders through the user’s calendar, and search engines can produce smarter search results.



Attribute Value Description
datetime datetime Represent a machine-readable format of the <time> element

Global Attributes

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

Event Attributes

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

Related Pages

HTML DOM reference: Time Object

Related Articles