Specifying Time

You can mark up a precise time or calendar date with the time element. This element is new in HTML5. (See the sidebar “Understanding the datetime Format” for more specifics about the calendar date system.)

One of the most common uses of time is to indicate the publication date of an article element. To do so, include the pubdate attribute. The time element with pubdate represents the publication date of the nearest ancestor article element Image. You could also time-stamp an article’s reader-submitted comments with time, datetime, and pubdate, assuming each comment is wrapped in an article element that is nested in the article to which ...

Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.