You use the time element to represent a time of day or a date. The datetime attribute specifies the date or time in a format specified by RFC3339(http://tools.ietf.org/html/rfc3339).
<time> |
Yes | Yes | Yes | Yes | Yes |
The <time> tag is new in HTML5.
Attribute | Value | Description |
---|---|---|
datetime | datetime | Represent a machine-readable date/time |
The <time> tag supports the Global Attributes in HTML.
The <time> tag supports the Event Attributes in HTML.
None.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<time datetime="15:00">3 o'clock</time> on
<time datetime="2011-12-7">December 7th</time>.
</body> <!--from ww w . ja v a 2s . co m-->
</html>