HTML <time> tag

Updated: 11/13/2018 by Computer Hope
HTML time tag

When writing in HTML (hypertext markup language), 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, and related attributes and browser compatibility.

Example of <time> 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

All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <time> tag has the following unique attributes.

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

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions Not supported 22.0+ 7.0+ 49.0+ 62.0+

Browser, Compatibility, Container tag, URL, Web design terms