Javatpoint Logo
Javatpoint Logo

HTML Time Tag

HTML <time> tag is used to define date and time. It displays time value in a 24 hour clock or a precise date in a Gregorian calendar in HTML.

It is used to encode dates and times in a machine-readable way to make easy to mark or schedule your task.

It also helps search engines to produce smarter search results.

HTML <time> is a new tag and introduced in HTML5.

Let's see the syntax to define date and time.


Attribute

There is only one specific attribute of HTML5 time tag.

AttributeDescription
datetimeIt is used to define machine-readable date/time within the time element.

HTML time tag example

Test it Now

Output:

We open our shop at am.

The business meeting is scheduled on .

The wedding of Salman's sister was scheduled at .


In this example, First line in the body tag defines basic usage of time tag.

Second line shows how to use the datetime attribute to provide contents in a machine-readable format.

Third line uses the datetime attribute to provide an even more specific date and time.


The <time> tag also supports global attributes and event attributes in HTML 5.


Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<time>YesYesYesYesYes
Next TopicHTML Main Tag




Let's Work Together!

Javatpoint is passionate to offer better content to the world. Please mail your contribution to contribute@javatpoint.com. We will show your name and create your user profile. You can contribute the following things:
  • Article on Any Topic (which is not available on Javatpoint)
  • Your Interview Experience on Company
  • Company Interview Questions with Answers
  • Recruitment Process of Company
  • Programs, and Algorithm
  • Videos
  • Test Paper
  • Improve Article

Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials