HTML <time> (Time) Tag

❮ Previous Reference Next ❯

Example

<p>The program starts at <time datetime="2021-01-01T01:00:00">01:00</time>.</p>

Meaning

The <time> element encloses content that represents a date and/or time.

This element should contain content that is in the correct format unless the datetime attribute is used.

Valid datetime Values:

Possible Values
a valid year string 2011
a valid month string 2011-11
a valid date string 2011-11-18
a valid yearless date string 11-18
a valid week string 2011-W47
a valid time string
  • 14:54
  • 14:54:39
  • 14:54:39.929
a valid local date and time string
  • 2011-11-18T14:54:39.929
  • 2011-11-18 14:54:39.929
a valid global date and time string
  • 2011-11-18T14:54:39.929Z
  • 2011-11-18T14:54:39.929-0400
  • 2011-11-18T14:54:39.929-04:00
  • 2011-11-18 14:54:39.929Z
  • 2011-11-18 14:54:39.929-0400
  • 2011-11-18 14:54:39.929-04:00
a valid duration string PT4H18M3S

Version: HTML 5


Standard Syntax

<time datetime="dateTime">...</time>



Browser Support




Status







Attributes

Attribute Value Description
datetime dateTime Specifies the date or time that the element represents.
pubdate pubdate Specifies that the date and time given by this element should be applied as the publication date of an enclosing <article> element.



Global Attributes

The <time> element also supports the Global Attributes in HTML.


Event Attributes

The <time> element also supports the Event Attributes in HTML.




By Default CSS Value(s)

None.




Related Tags:

<a>, <abbr>, <b>, <bdi>, <bdo>, <br>, <cite>, <code>, <data>, <dfn>, <em>, <i>, <kbd>, <mark>, <q>, <rp>, <rt>, <ruby>, <s>, <samp>, <small>, <span>, <strong>, <sub>, <sup>, <u>, <var> and <wbr>
❮ Previous Reference Next ❯