HTML Tag Reference - HTML tag <time>








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).

Browser compatibility

<time> Yes Yes Yes Yes Yes

What's new in HTML5

The <time> tag is new in HTML5.

Attribute

Attribute Value Description
datetime datetime Represent a machine-readable date/time




Global Attributes

The <time> tag supports the Global Attributes in HTML.

Event Attributes

The <time> tag supports the Event Attributes in HTML.

Default CSS Settings

None.

Example

<!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>

Click to view the demo