Question

I’d like to include published and modified time of an article. I looked through documentation and cannot find info about this.

So far, I got this:

<article>                           
  <h2>Summer</h2>
  <p>Also the favorite word of <strong>5000</strong> people more</p>
  <time pubdate="2009-11-13">1s</time>
  <time datetime="2009-11-13">10s</time>
</article>
Was it helpful?

Solution

The time element can’t have a pubdate attribute. (It was part of early drafts, but it got removed.)

HTML5 itself doesn’t provide a way to specify that a date is a publication or a modification date.

If you need to specify this in a machine-readable way, you could use an appropriate vocabulary. For example, the vocabulary Schema.org defines the properties datePublished and dateModified for CreativeWork (and its sub-types).

OTHER TIPS

dokieli is using

<!doctype html><html lang="en">
<head><title>demo</title></head>
<body>

<time
 datatype="xsd:dateTime"
 property="schema:dateModified"
 datetime="2016-02-06T00:00:00Z"
 content="2016-02-06T00:00:00Z"
>2016-02-06</time>

</body></html>

see full example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top