time Element

Description

You can use the time element to represent a time or a date. The time element has two local attributes:datetime, pubdate .

If the Boolean pubdate attribute is present, then the time element is assumed to be the publication date of the entire HTML document or the nearest article element.

The datetime attribute specifies the date or time in a format specified by RFC3339, which you can find at http://tools.ietf.org/html/rfc3339.

Example

The following code shows the time element in use.


<!DOCTYPE HTML>
<html>
<body>
  I bought a book at<!--from  w w  w. j a v a2 s.c o  m-->
  <time datetime="15:00">3 o'clock</time>
  on
  <time datetime="2012-12-7">December 7th</time>
  .
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed