HTML | <time> Tag

The <time> tag is used to display the human-readable data/time. It can also be used to encode dates and times in a machine-readable form. The main advantage for users is that they can offer to add birthday reminders or scheduled events in their calender’s and search engines can produce smarter search results.

Syntax:

<time attribute> Time... <time>

Attributes: This tag contains single attribute datetime which is used to define the date/time in a machine-readable form of the <time> element.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>time tag</title>
        <style>
            body {
                text-align:center;
            }
            h1 {
                color:green;
            }
        </style>
    </head>
    <body>
        <h1>GeeksForGeeks</h1>
        <h2><time> Tag</h2>
        <p>I Wake up at <time>6.00</time> in every morning.</p>
        <p>Jawahar lal Nehru birthday is celebrated on 
        <time datatime="2018--11-14 12:00">children's day.</time></p>
    </body>
</html>                    

chevron_right


Output:

Supported Browsers: The browser supported by <time> tag are listed below:

  • Apple Safari 5.0 and above
  • Google Chrome 6.0 and above
  • Firefox 4.0 and above
  • Opera 11.1 and above
  • Internet Explorer 9.0 and above


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.