Is it correct to use the <time> tag to display dates in HTML5

Is this code correct for date display?

<time class="entry-date" datetime="2010-09-27T10:50:15+00:00" pubdate>27/09/2010</time>
+3
source share
3 answers

Yup is right. Take a look at this project specification to see valid date time strings: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#global-dates-and-times .

Your time is September 27, 2010, 15:00 UTC.

+4
source

Yes, this is the one you should use according to:

http://www.w3schools.com/html5/html5_reference.asp

The tag defines time or dates or both.

+4
source

, :

  • time /
  • datetime W3C: s HTML5
  • The attribute is pubdatealso great if the tag timeis inside the tag articleand that the tag timeactually indicates the time of publication of the article
+2
source

Source: https://habr.com/ru/post/1785386/


All Articles