HTML <time>Tag: The HTML<time> tag specifies a human-readable date/time. And this element can also be used to encode dates and times in a machine-readable way so that user agents can offer to add birthday reminders or scheduled events to the user’s calendar, and search engines can produce smarter search results.
HTML <time>Tag
This HTML time tag supports both the global and the event attributes.
Syntax: <time> Text </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.
Browser compatibility
The HTML<time> tag is supported by different types of browsers.
- Chrome
- Firefox
- Opera
- Safari
- Internet Explorer
Example:
<!DOCTYPE html> <html> <body> <p>We open at <time>10:00</time> every morning.</p> </body> </html>
Output:
We open at 10:00 every morning.
Attributes that are supported by the <time> tag
Attribute | Value | Description |
---|---|---|
datetime | datetime | Represent a machine-readable date/time of the |