HTML <time> datetimeProperty

HTML <time> tag

Example

time element for the specified date:

<p>I am<time datetime="2008-02-14">Valentine's Day</time>I have a date.</p>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The datetime attribute does not render any special effect in any browser.


Definition and Usage

The datetime attribute specifies the date or time. This attribute is used when the date or time is not specified in the content of the element.


Differences between HTML 4.01 and HTML5

The <time> tag is a new tag in HTML5.


Syntax

<time datetime="YYYY-MM-DDThh:mm:ssTZD">

Property value

Value Description
YYYY-MM-DDThh:mm:ssTZD

Date or time. The components are explained below:

  • YYYY - Year (e.g., 2011)
  • MM - month (e.g., 01 means January)
  • DD - Day (e.g., 08)
  • T - required separator, if time is specified
  • hh - hour (e.g., 22 means 10.00pm)
  • mm - Minute (e.g., 55)
  • ss - Second (e.g., 03)
  • TZD - time zone identifier (Z stands for Zulu, also known as Greenwich Mean Time)


HTML <time> tagother extensions