Name
time — HTML5
Synopsis
<time> . . . </time>
Represents a time on a 24-hour clock or a date and/or a date on
the Gregorian calendar. The time
element could be used to pass time and date information in a
machine-readable manner to other applications (e.g., saving an event
to a personal calendar), or to restyle time information into alternate
formats (e.g., 18:00 to 6 p.m.). The time element is not intended to
be used to mark up times for which a precise time or date cannot be
established, such as “the end of last year” or “the turn of the
century.”
Notes
HTML5 only.
Start/End Tags
Required/Required
Attributes
HTML5 Global Attributes
pubdate
(pubdate="pubdate"
in XHTML)Indicates that the date and time provided by
datetime
is the publication date and time of the parent element (thearticle
or whole document).datetime="
YYYY-MM-DDThh:mm:ssTZD
"
Identifies the date or time being specified. If the
datetime
attribute is used, the time element may be empty.
Examples
The deadline for entries is <time datetime="2010-09-01T 20:00-05:00">September 1, 2010, 8pm EST</time> Hours: <time>8am</time> to <time>9pm</time>
Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.