content logo

Learn HTML:

Html time tag

The HTML <time> tag is used for declaring the date and/or time within an HTML document.

The <time> tag was introduced in HTML 5.

Example

In the pane below, you will find three examples.

  1. Example 1 demonstrates basic usage of the <time> tag.
  2. Example 2 shows how to use the datetime attribute in order to provide the contents in a machine-readable format.
  3. Example 3 uses the datetime attribute to provide an even more specific date and time than the previous example.
<p>On Saturdays, we open at <time>09:00</time>.</p>

<p>The concert is <time datetime="2009-02-18">next Wednesday</time>.</p>

<p>We finally hit the road at <time datetime="2009-02-17T05:00-07:00">5am last Tuesday</time>.</p>

Element-Specific Attributes

The following table shows the attributes that are specific to this tag/element.

Attribute Description
datetime Specifies the date or time being specified. Must be a representation of the element's contents in a machine-readable format. Must be a valid date or time string.
#

HTML Time Example

#

HTML Time Code

#

HTML Time Tutorial