Home Tutorial Html Html5 HTML5 time tag, Example of <time> in html5

 
 

HTML5 time tag, Example of <time> in html5
Posted on: September 17, 2010 at 12:00 AM
In this example, We will inform you about the <time> tag in html5.

HTML5 time tag, Example of <time> in html5

In this example, We will inform you about the <time> tag in html5. The <time> tag is used to define the date time in the html document. We can define date, time or date&time both by using this tag in the html document.

Declaration Syntax:

The syntax of <time> tag is as:

<time datetime="value"> Text Here</time>

This tag is new introduction in html5. This tag have a specific attribute "datetime" is as:

datetime="value"    The value of the attribute must be valid date or time. This attribute specify the date and time.

                                  The date or time must be in standard format

Example: time_tag.html:

<!DOCTYPE html>
<html>
  <head>
      <title>Example of Time Tag</title>
  </head>
   <body>The Timing of the meeting<br>
        is <time datetime="2010-09-16">6pm  at delhi house.</time>
  </body> 
</html>

Output:

Download This Example:

difference between html4.01 and html5:

This is new introduction in html5.

Related Tags for HTML5 time tag, Example of <time> in html5:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.