I have been going through some tutorials on the <time>
tag, but I honestly don't see why we are using it.
For example:
Published <time pubdate datetime="2011-07-03">07/03</time>
If we are going to have a string 07/03 anyway, what is the purpose of using a time tag? It doesn't validate anything.
The <time> HTML element represents a specific period in time. It may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders. It may represent one of the following: A time on a 24-hour clock.
Definition and Usage. The datetime attribute represent a machine-readable format of a <time> element.
Current Date and Time is stored inside javascript variable. Then using TextContent property the content of HTML span element is set with current and time. Unique ID is given to span tag so that we can use it on getElementById() method to dispaly the current date and time.
The <time> datetime Attribute in HTML is used to defines the machine-readable date/time of the <time> element. The date-time is inserted in the format YYYY-MM-DDThh:mm:ssTZD.
The point of this tag, as with a number of the new "semantic" HTML5 tags, is to make it easier for programs to index your data.
A script can go through and easily find out what the published date is for your blog articles if it sees a <time>
tag, without having to parse any of a number of ways this could be represented (for consumption by a human being), which would be a much more complex and error-prone task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With