The html5 tutorials

 
About HTML5
Home
Introduction to HTML5
Features of HTML5
Older versions Vs. HTML5
 
Tags  
source
article
aside
audio
canvas
command
datalist
details
embed
figcaption
figure
footer
header
hgroup
keygen
mark
meter
nav
output
progress
ruby
section
summary
time
video
wbr
 

The <time> Tag

Many times, you may need to add time and date in your web page. HTML5 gives you ability to incorporate time on your web page using time tag. To add on a time or a date or both on a particular web page, you can use time tag that has been included in HTML5 (represented as <time>). This tag may record what a user is doing and for how long.

time tag example code:

<html>
  <body>
     We arrived at <time>09:00</time>
  </body>
</html>

Example code for date:

<html>
  <body>
     I have an appointment with doctor on date <time datetime="2010-09-02"> day</time>.
  </body>
</html>

Attributes of Audio tag

Attribute Values Description of the attribute
datetime datetime With this attribute, date and time can be defined in this element.