How to add a date and time in HTML5?

HTMLFront End TechnologyWeb Development

Use the <time> tag to add date and time. The HTML <time> tag is used for displaying the human readable date and time.

The HTML <time> tag also supports the following additional attribute −

Attribute
Value
Description
datetime
datetime
It is a machine readable date time

Example

You can try to run the following code to learn how to add date and time <details> in HTML5 −

<!Doctype html>
<html>
   <head>
      <title>HTML time Tag</title>
   </head>
   <body>
      <p>The time is <time>08:30 pm</time></p>
   </body>
</html>
raja
Published on 13-Mar-2018 11:10:23
Advertisements