HTML time tag
HTML <time> tag defines time with the machine-readable value of time and date values.
<p>Time: <time>15:35</time></p> <p>Time: <time>15:35:22.722</time></p> <p>Date: <time>2016-12-05</time></p></>
You may consider we don't need to use time tag. But it has been specially designed for time and date purposes. So that system or machine read it as date and time.
The values of the datetime value may differ.
In the value, we first write year.
After the year, a month is written.
After the month, the day of the month is written.
To write time along the date, write 'T'.
Then write hours: minutes: seconds.
Both ending and starting tags are necessary for the time element.
All the global attributes are applicable on the time element.
Was this article helpful?