Open In App

HTML <time> Tag

Last Updated : 14 Dec, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The <time> tag is used to display the human-readable date/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 to their calendars and search engines can produce smarter search results.

Note: This tag also supports Global Attribute and Event attributes.

Syntax

<time attribute> Time... </time>

Attribute

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

Example: This example describes the usage of the HTML <time> Tag.

HTML




<!DOCTYPE html>
<html>
 
<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 datetime="2018--11-14 12:00">
            children's day.</time>
    </p>
</body>
 
</html>


Output: 

Supported Browsers

  • Google Chrome 62.0 and above
  • Edge 18.0 and above
  • Firefox 22.0 and above
  • Opera 49.0 and above
  • Safari 7.0 and above

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads