HTML <time> Tag

Description

Marks the text inside the <time> HTML element as a date, time, or both. It can be specified directly inside the <time> container, or it can be specified through the datetime attribute.

Properties

Permitted Parents
Any element that accepts phrasing content
Content
Inline and text, but no descendant <time> elements
Start/End Tags
Start tag: required, End tag: required

Example

<p>Our business hours are <time>8:30</time> until <time>4:30</time></p>
<p>My holidays start on <time datetime="2018-12-25 00:00">Christmas day</time>.</p>

Attributes

Attribute Definition
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 HTML5

Event Attributes

The <time> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
XYes6222497
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
626222464X