HTML and CSS Reference
In-Depth Information
Element-Specific Attributes
datetime This attribute is used to indicate the date and time of the enclosed content. The
value of the attribute is a date in a special format as defined by ISO 8601. The basic date
format is
YYYY-MM-DDThh:mm:ssTZD
where the following is true:
YYYY=four-digit year such as 1999
MM=two-digit month (01=January, 02=February, and so on.)
DD=two-digit day of the month (01 through 31)
hh=two-digit hour (00 to 23) (24-hour clock, not AM or PM)
mm=two-digit minute (00 through 59)
ss=two-digit second (00 through 59)
TZD=time zone designator
The time zone designator is either Z , which indicates Universal Time Coordinate or
coordinated universal time format (UTC), or + hh : mm , which indicates that the time is a local
time that is hh hours and mm minutes ahead of UTC. Alternatively, the format for the time
zone designator could be - hh : mm , which indicates that the local time is behind UTC. Note
that the letter T actually appears in the string, all digits must be used, and 00 values for
minutes and seconds might be required. An example value for the datetime attribute
might be 1999-10-6T09:15:00-05:00 , which corresponds to October 6, 1999, 9:15 A . M .,
U.S. Eastern Standard Time.
pubdate This Boolean attribute, when specified, indicates that the date and time given
by this element should be applied as the publication date of an enclosing article element.
If there is no enclosing article element, the publication date would apply to the entire
document. Under XHTML5, the value of the attribute should be pubdate for XML syntax
conformance.
Examples
<p> My son was born on <time datetime= "2006-01-13" > Friday the 13th </time> so
it is my new lucky day. </p>
<p> Today it is <time> 2010-07-08 </time> which is an interesting date. </p>
<p> When did the Moon runaway? <time> 1999-09-13T09:15:00-05:00 </time></p>
<!-- example shows the pubdate application to the enclosing article -->
<article id="article1" >
<header>
<h1> HTML5 is Coming Soon! </h1>
<p><time pubdate datetime="2009-10-31T12:30-11:00"></time></p>
</header>
<p> The new HTML5 specification is in the works. While many features are
not currently implemented or even well defined yet, progress is being made.
Stay tuned to see more new HTML elements added to your Web documents in the
years to come. </p>
</article>
Search WWH ::




Custom Search