X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <time> Tag


Example

How to define a time and a date:

<p>We open at <time>10:00</time> every morning.</p>

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

Try it Yourself »

Definition and Usage

The <time> tag defines either a time (24 hour clock), or a date in the Gregorian calendar, optionally with a time and a time-zone offset.

This element can be used as a way to encode dates and times in a machine-readable way so that, for example, user agents can offer to add birthday reminders or scheduled events to the user's calendar, and search engines can produce smarter search results.


Browser Support

The numbers in the table specifies the first browser version that fully supports the element.

Element
<time> 6.0 9.0 4.0 5.0 11.1


Differences Between HTML 4.01 and HTML5

The <time> tag is new in HTML5.


Attributes

= New in HTML5.

Attribute Value Description
datetime datetime Gives the date/time being specified. Otherwise, the date/time is given by the element's contents

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



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook