jump

HTML 5: The Markup Language (ARIA Edition)

timedate and/or time NEW # T

The time element represents a date and/or time.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
datetime (any) = date or time #
Specifies the date or time that the element represents.
Any one of the following:
datetime (date only) = date #
Specifies the date that the element represents.
A valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0.

Example:

1996-12-19
datetime (date and time) = date and time #
Specifies the date and time that the element represents.
A valid date-time as defined in [RFC 3339], with these additional qualifications:
  • the literal letters T and Z in the date/time syntax must always be uppercase
  • the date-fullyear production is instead defined as four or more digits representing a number greater than 0

Examples:

1990-12-31T23:59:60Z
1996-12-19T16:39:57-08:00

Additional constraints and admonitions #

Tag omission #

A time element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Details #

If the datetime (any) attribute is not specified, then the date or time represented is given by the contents of the element, and the character data in those contents must conform to the date-or-time datatype.

DOM interface #

interface HTMLTimeElement : HTMLElement {
           attribute DOMString datetime (any);
};