What's the point of using the HTML5 <time> tag?

I tested the <time> tags, but honestly I don’t understand why we use it.

For example:

 Published <time pubdate datetime="2011-07-03">07/03</time> 

If in any case we have line 07/03, what is the purpose of using the time tag? He does not confirm anything.

+60
html5
Jul 28 2018-11-11T00:
source share
4 answers

The point of this tag, as well as a number of new "semantic" HTML5 tags, is to make it easier for programs to index your data.

A script can go through and easily find out that the published date is for your blog articles if it sees the <time> , without having to parse any of the several ways this can be presented (for human consumption), which would be much more complex and error prone task.

+61
Jul 28 2018-11-11T00: 00Z
source share

This is in a machine-readable format, so any script or search engine that reads your content can understand the date / time of publication. Thus, you can easily format it for readers without affecting the readability of the machine. It falls under microformats , which is good.

eg. <time pubdate datetime="2011-07-03">3 days ago</time> looks good for people and computers.

+45
Jul 28 2018-11-11T00:
source share

HTML5 time element

When in doubt, look at the specification!

A time element represents its contents, along with a machine-readable form of that content in the datetime attribute. The type of content is limited to various types of dates, times, time zone offsets, and duration, as described below.

From the HTML5.2 specification on the W3C website: https://www.w3.org/TR/html52/textlevel-semantics.html#the-time -element

Take a look at the site for more information. :)

+17
Jul 30 '11 at 16:07
source share
+4
Jul 30 '11 at 16:01
source share



All Articles