10 Jul HTML5 time Tag
As the name tells, the HTML5 time tag is used to show human readable date and time. If you want to show the date and time on your website, then use the time tag, for example, meeting date and time, event date, interview date, etc.
Example
Here, we will be showing the meeting date and time as well as office hours,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<!DOCTYPE html> <html> <head> <title>Understanding HTML5 Time tag</title> </head> <body> <p>The meeting was on <time datetime="2017-02-5T14:00">February 5</time>.</p></p> <p>Our office hours: <time>09:00</time>AM to <time>06:00</time>PM</p> </body> </html> |
Here’s the output,
Attributes
datetime– It displays machine readable date and time.
No Comments