HTML <time> tag

Updated: 04/26/2017 by Computer Hope

HTML time tagWhen writing in HTML, the <time> tag is an inline element used to designate a date and time that are readable by human beings. It may also be used to present dates and times in a machine readable format; which enables event scheduling for a user's calendar. The following sections contain information about this tag, including an example of it in use, as well as related attributes and browser compatibility.

Example code

<p>The dentist's office opens at <time>8:00</time>.</p>

<p>Your appointment is at <time datetime="2015-05-14 9:00">
	9:00 on May 14th</time>.</p>

Example result

The dentist's office opens at .

Your appointment is at .

Attributes

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows the only current, unique, HTML attribute for the <time> tag, as well as a description.

Attribute Description
datetime Used to designate a machine-readable date and time in a time element

Compatibility

Internet Explorer Firefox Safari Opera Chrome
9.0+ 4.0+ 5.0+ 11.1+ 6.0+

Browser, Compatibility, URL