[html5] r6827 - / images
whatwg at whatwg.org
whatwg at whatwg.org
Fri Nov 18 11:43:58 PST 2011
Author: ianh
Date: 2011-11-18 11:43:57 -0800 (Fri, 18 Nov 2011)
New Revision: 6827
Modified:
complete.html
images/content-venn.svg
index
source
Log:
[acgiowt] (1) the <time> element is dead, long live the <time> element
Modified: complete.html
===================================================================
--- complete.html 2011-11-12 00:22:15 UTC (rev 6826)
+++ complete.html 2011-11-18 19:43:57 UTC (rev 6827)
@@ -240,7 +240,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
- <h2 class="no-num no-toc">Living Standard — Last Updated 11 November 2011</h2>
+ <h2 class="no-num no-toc">Living Standard — Last Updated 18 November 2011</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
@@ -334,11 +334,14 @@
<ol>
<li><a href=#months><span class=secno>2.5.5.1 </span>Months</a></li>
<li><a href=#dates><span class=secno>2.5.5.2 </span>Dates</a></li>
- <li><a href=#times><span class=secno>2.5.5.3 </span>Times</a></li>
- <li><a href=#local-dates-and-times><span class=secno>2.5.5.4 </span>Local dates and times</a></li>
- <li><a href=#global-dates-and-times><span class=secno>2.5.5.5 </span>Global dates and times</a></li>
- <li><a href=#weeks><span class=secno>2.5.5.6 </span>Weeks</a></li>
- <li><a href=#vaguer-moments-in-time><span class=secno>2.5.5.7 </span>Vaguer moments in time</a></ol></li>
+ <li><a href=#yearless-dates><span class=secno>2.5.5.3 </span>Yearless dates</a></li>
+ <li><a href=#times><span class=secno>2.5.5.4 </span>Times</a></li>
+ <li><a href=#local-dates-and-times><span class=secno>2.5.5.5 </span>Local dates and times</a></li>
+ <li><a href=#time-zones><span class=secno>2.5.5.6 </span>Time zones</a></li>
+ <li><a href=#global-dates-and-times><span class=secno>2.5.5.7 </span>Global dates and times</a></li>
+ <li><a href=#weeks><span class=secno>2.5.5.8 </span>Weeks</a></li>
+ <li><a href=#durations><span class=secno>2.5.5.9 </span>Durations</a></li>
+ <li><a href=#vaguer-moments-in-time><span class=secno>2.5.5.10 </span>Vaguer moments in time</a></ol></li>
<li><a href=#colors><span class=secno>2.5.6 </span>Colors</a></li>
<li><a href=#space-separated-tokens><span class=secno>2.5.7 </span>Space-separated tokens</a></li>
<li><a href=#comma-separated-tokens><span class=secno>2.5.8 </span>Comma-separated tokens</a></li>
@@ -498,24 +501,25 @@
<li><a href=#the-dfn-element><span class=secno>4.6.8 </span>The <code>dfn</code> element</a></li>
<li><a href=#the-abbr-element><span class=secno>4.6.9 </span>The <code>abbr</code> element</a></li>
<li><a href=#the-data-element><span class=secno>4.6.10 </span>The <code>data</code> element</a></li>
- <li><a href=#the-code-element><span class=secno>4.6.11 </span>The <code>code</code> element</a></li>
- <li><a href=#the-var-element><span class=secno>4.6.12 </span>The <code>var</code> element</a></li>
- <li><a href=#the-samp-element><span class=secno>4.6.13 </span>The <code>samp</code> element</a></li>
- <li><a href=#the-kbd-element><span class=secno>4.6.14 </span>The <code>kbd</code> element</a></li>
- <li><a href=#the-sub-and-sup-elements><span class=secno>4.6.15 </span>The <code>sub</code> and <code>sup</code> elements</a></li>
- <li><a href=#the-i-element><span class=secno>4.6.16 </span>The <code>i</code> element</a></li>
- <li><a href=#the-b-element><span class=secno>4.6.17 </span>The <code>b</code> element</a></li>
- <li><a href=#the-u-element><span class=secno>4.6.18 </span>The <code>u</code> element</a></li>
- <li><a href=#the-mark-element><span class=secno>4.6.19 </span>The <code>mark</code> element</a></li>
- <li><a href=#the-ruby-element><span class=secno>4.6.20 </span>The <code>ruby</code> element</a></li>
- <li><a href=#the-rt-element><span class=secno>4.6.21 </span>The <code>rt</code> element</a></li>
- <li><a href=#the-rp-element><span class=secno>4.6.22 </span>The <code>rp</code> element</a></li>
- <li><a href=#the-bdi-element><span class=secno>4.6.23 </span>The <code>bdi</code> element</a></li>
- <li><a href=#the-bdo-element><span class=secno>4.6.24 </span>The <code>bdo</code> element</a></li>
- <li><a href=#the-span-element><span class=secno>4.6.25 </span>The <code>span</code> element</a></li>
- <li><a href=#the-br-element><span class=secno>4.6.26 </span>The <code>br</code> element</a></li>
- <li><a href=#the-wbr-element><span class=secno>4.6.27 </span>The <code>wbr</code> element</a></li>
- <li><a href=#usage-summary><span class=secno>4.6.28 </span>Usage summary</a></ol></li>
+ <li><a href=#the-time-element><span class=secno>4.6.11 </span>The <code>time</code> element</a></li>
+ <li><a href=#the-code-element><span class=secno>4.6.12 </span>The <code>code</code> element</a></li>
+ <li><a href=#the-var-element><span class=secno>4.6.13 </span>The <code>var</code> element</a></li>
+ <li><a href=#the-samp-element><span class=secno>4.6.14 </span>The <code>samp</code> element</a></li>
+ <li><a href=#the-kbd-element><span class=secno>4.6.15 </span>The <code>kbd</code> element</a></li>
+ <li><a href=#the-sub-and-sup-elements><span class=secno>4.6.16 </span>The <code>sub</code> and <code>sup</code> elements</a></li>
+ <li><a href=#the-i-element><span class=secno>4.6.17 </span>The <code>i</code> element</a></li>
+ <li><a href=#the-b-element><span class=secno>4.6.18 </span>The <code>b</code> element</a></li>
+ <li><a href=#the-u-element><span class=secno>4.6.19 </span>The <code>u</code> element</a></li>
+ <li><a href=#the-mark-element><span class=secno>4.6.20 </span>The <code>mark</code> element</a></li>
+ <li><a href=#the-ruby-element><span class=secno>4.6.21 </span>The <code>ruby</code> element</a></li>
+ <li><a href=#the-rt-element><span class=secno>4.6.22 </span>The <code>rt</code> element</a></li>
+ <li><a href=#the-rp-element><span class=secno>4.6.23 </span>The <code>rp</code> element</a></li>
+ <li><a href=#the-bdi-element><span class=secno>4.6.24 </span>The <code>bdi</code> element</a></li>
+ <li><a href=#the-bdo-element><span class=secno>4.6.25 </span>The <code>bdo</code> element</a></li>
+ <li><a href=#the-span-element><span class=secno>4.6.26 </span>The <code>span</code> element</a></li>
+ <li><a href=#the-br-element><span class=secno>4.6.27 </span>The <code>br</code> element</a></li>
+ <li><a href=#the-wbr-element><span class=secno>4.6.28 </span>The <code>wbr</code> element</a></li>
+ <li><a href=#usage-summary><span class=secno>4.6.29 </span>Usage summary</a></ol></li>
<li><a href=#edits><span class=secno>4.7 </span>Edits</a>
<ol>
<li><a href=#the-ins-element><span class=secno>4.7.1 </span>The <code>ins</code> element</a></li>
@@ -5626,8 +5630,99 @@
</ol></div>
- <h5 id=times><span class=secno>2.5.5.3 </span>Times</h5>
+ <h5 id=yearless-dates><span class=secno>2.5.5.3 </span>Yearless dates</h5>
+ <p>A <dfn id=concept-yearless-date title=concept-yearless-date>yearless date</dfn> consists
+ of a month and a day, but with no associated year.</p>
+
+ <p>A string is a <dfn id=valid-yearless-date-string>valid yearless date string</dfn> representing
+ a month <var title="">month</var> and a day <var title="">day</var>
+ if it consists of the following components in the given order:</p>
+
+ <ol><li>Optionally, two U+002D HYPHEN-MINUS characters (-)</li>
+
+ <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
+ representing the month <var title="">month</var>, in the range
+ 1 ≤ <var title="">month</var> ≤ 12</li>
+
+ <li>A U+002D HYPHEN-MINUS character (-)</li>
+
+ <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
+ representing <var title="">day</var>, in the range
+ 1 ≤ <var title="">day</var> ≤ <var title="">maxday</var> where <var title="">maxday</var> is the <a href=#number-of-days-in-month-month-of-year-year title="number of days in month month of year year">number of
+ days</a> in the month <var title="">month</var> and any
+ arbitrary leap year (e.g. 4 or 2000)</li>
+
+ </ol><p class=note>In other words, if the <var title="">month</var> is
+ "<code title="">02</code>", meaning February, then the day can be
+ 29, as if the year was a leap year.</p>
+
+ <div class=impl>
+
+ <p>The rules to <dfn id=parse-a-yearless-date-string>parse a yearless date string</dfn> are as
+ follows. This will return either a month and a day, or nothing. If
+ at any point the algorithm says that it "fails", this means that it
+ is aborted at that point and returns nothing.</p>
+
+ <ol><li><p>Let <var title="">input</var> be the string being
+ parsed.</li>
+
+ <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
+ string.</li>
+
+ <li><p><a href=#parse-a-yearless-date-component>Parse a yearless date component</a> to obtain <var title="">month</var> and <var title="">day</var>. If this returns
+ nothing, then fail.</p>
+
+ <li><p>If <var title="">position</var> is <em>not</em> beyond the
+ end of <var title="">input</var>, then fail.</li>
+
+ <li><p>Return <var title="">month</var> and <var title="">day</var>.</li>
+
+ </ol><p>The rules to <dfn id=parse-a-yearless-date-component>parse a yearless date component</dfn>, given an
+ <var title="">input</var> string and a <var title="">position</var>,
+ are as follows. This will return either a month and a day, or
+ nothing. If at any point the algorithm says that it "fails", this
+ means that it is aborted at that point and returns nothing.</p>
+
+ <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+ U+002D HYPHEN-MINUS characters (-). If the collected sequence is
+ not exactly zero or two characters long, then fail.</li>
+
+ <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then fail. Otherwise,
+ interpret the resulting sequence as a base-ten integer. Let that
+ number be the <var title="">month</var>.</li>
+
+ <li><p>If <var title="">month</var> is not a number in the range
+ 1 ≤ <var title="">month</var> ≤ 12, then
+ fail.</li>
+
+ <li><p>Let <var title="">maxday</var> be the <a href=#number-of-days-in-month-month-of-year-year title="number of
+ days in month month of year year">number of days</a> in month
+ <var title="">month</var> of any arbitrary leap year (e.g. 4 or
+ 2000).</li>
+
+ <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> or if the character at <var title="">position</var> is not a U+002D HYPHEN-MINUS character,
+ then fail. Otherwise, move <var title="">position</var> forwards
+ one character.</li>
+
+ <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then fail. Otherwise,
+ interpret the resulting sequence as a base-ten integer. Let that
+ number be the <var title="">day</var>.</li>
+
+ <li><p>If <var title="">day</var> is not a number in the range
+ 1 ≤ <var title="">day</var> ≤ <var title="">maxday</var>, then fail.</li>
+
+ <li><p>Return <var title="">month</var> and <var title="">day</var>.</li>
+
+ </ol></div>
+
+
+ <h5 id=times><span class=secno>2.5.5.4 </span>Times</h5>
+
<p>A <dfn id=concept-time title=concept-time>time</dfn> consists of a specific
time with no time-zone information, consisting of an hour, a minute,
a second, and a fraction of a second.</p>
@@ -5764,7 +5859,7 @@
</ol></div>
- <h5 id=local-dates-and-times><span class=secno>2.5.5.4 </span>Local dates and times</h5>
+ <h5 id=local-dates-and-times><span class=secno>2.5.5.5 </span>Local dates and times</h5>
<p>A <dfn id=concept-datetime-local title=concept-datetime-local>local date and time</dfn>
consists of a specific proleptic Gregorian date, consisting of a
@@ -5815,9 +5910,140 @@
</ol></div>
+ <h5 id=time-zones><span class=secno>2.5.5.6 </span>Time zones</h5>
- <h5 id=global-dates-and-times><span class=secno>2.5.5.5 </span>Global dates and times</h5>
+ <p>A <dfn id=concept-timezone title=concept-timezone>time-zone offset</dfn> consists
+ of a signed number of hours and minutes.</p>
+ <p>A string is a <dfn id=valid-time-zone-offset-string>valid time-zone offset string</dfn>
+ representing a time-zone offset if it consists of either:</p>
+
+
+ <ul><li><p>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only
+ if the time zone is UTC</li>
+
+ <li>
+
+ <p>Or, the following components, in the given order:</p>
+
+ <ol><li>Either a U+002B PLUS SIGN character (+) or, if the
+ time-zone offset is not zero, a U+002D HYPHEN-MINUS character
+ (-), representing the sign of the time-zone offset</li>
+ <!-- the -00:00 offset is disallowed because RFC3339 gives it a
+ special semantic -->
+
+ <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
+ representing the hours component <var title="">hour</var> of
+ the time-zone offset, in the range 0 ≤ <var title="">hour</var> ≤ 23</li>
+
+ <li>A U+003A COLON character (:)</li>
+
+ <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
+ representing the minutes component <var title="">minute</var>
+ of the time-zone offset, in the range 0 ≤ <var title="">minute</var> ≤ 59</li>
+
+ </ol></li>
+
+ </ul><p class=note>This format allows for time-zone offsets from -23:59
+ to +23:59. In practice, however, the range of offsets of actual time
+ zones is -12:00 to +14:00, and the minutes component of offsets of
+ actual time zones is always either 00, 30, or 45.</p>
+
+ <p class=note>See also the usage notes and examples in the <a href=#concept-datetime title=concept-datetime>global date and time</a> section below
+ for details on using time-zone offsets with historical times that
+ predate the formation of formal time zones.</p>
+
+ <div class=impl>
+
+ <p>The rules to <dfn id=parse-a-time-zone-offset-string>parse a time-zone offset string</dfn> are as
+ follows. This will return either a time-zone offset, or nothing. If
+ at any point the algorithm says that it "fails", this means that it
+ is aborted at that point and returns nothing.</p>
+
+ <ol><li><p>Let <var title="">input</var> be the string being
+ parsed.</li>
+
+ <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
+ string.</li>
+
+ <li><p><a href=#parse-a-time-zone-offset-component>Parse a time-zone offset component</a> to obtain
+ <var title="">timezone<sub title="">hours</sub></var> and <var title="">timezone<sub title="">minutes</sub></var>. If this returns
+ nothing, then fail.</p>
+
+ <li><p>If <var title="">position</var> is <em>not</em> beyond the
+ end of <var title="">input</var>, then fail.</li>
+
+ <li><p>Return the time-zone offset that is <var title="">timezone<sub title="">hours</sub></var> hours and <var title="">timezone<sub title="">minutes</sub></var> minutes from
+ UTC.</li>
+
+ </ol><p>The rules to <dfn id=parse-a-time-zone-offset-component>parse a time-zone offset component</dfn>, given
+ an <var title="">input</var> string and a <var title="">position</var>, are as follows. This will return either
+ time-zone hours and time-zone minutes, or nothing. If at any point
+ the algorithm says that it "fails", this means that it is aborted at
+ that point and returns nothing.</p>
+
+ <ol><li>
+
+ <p>If the character at <var title="">position</var> is a U+005A
+ LATIN CAPITAL LETTER Z character (Z), then:</p>
+
+ <ol><li><p>Let <var title="">timezone<sub title="">hours</sub></var>
+ be 0.</li>
+
+ <li><p>Let <var title="">timezone<sub title="">minutes</sub></var> be 0.</li>
+
+ <li><p>Advance <var title="">position</var> to the next character
+ in <var title="">input</var>.</li>
+
+ </ol><p>Otherwise, if the character at <var title="">position</var> is
+ either a U+002B PLUS SIGN (+) or a U+002D HYPHEN-MINUS (-),
+ then:</p>
+
+ <ol><li><p>If the character at <var title="">position</var> is a
+ U+002B PLUS SIGN (+), let <var title="">sign</var> be
+ "positive". Otherwise, it's a U+002D HYPHEN-MINUS (-); let <var title="">sign</var> be "negative".</li>
+
+ <li><p>Advance <var title="">position</var> to the next character
+ in <var title="">input</var>.</li>
+
+ <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then
+ fail. Otherwise, interpret the resulting sequence as a base-ten
+ integer. Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</li>
+
+ <li>If <var title="">timezone<sub title="">hours</sub></var> is
+ not a number in the range 0 ≤ <var title="">timezone<sub title="">hours</sub></var> ≤ 23, then fail.</li>
+
+ <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">hours</sub></var>.</li>
+
+ <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then
+ fail. Otherwise, move <var title="">position</var> forwards one
+ character.</li>
+
+ <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then
+ fail. Otherwise, interpret the resulting sequence as a base-ten
+ integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</li>
+
+ <li>If <var title="">timezone<sub title="">minutes</sub></var> is
+ not a number in the range 0 ≤ <var title="">timezone<sub title="">minutes</sub></var> ≤ 59, then fail.</li>
+
+ <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">minutes</sub></var>.</li>
+
+ </ol><p>Otherwise, fail.</p>
+
+ </li>
+
+ <li><p>Return <var title="">timezone<sub title="">hours</sub></var>
+ and <var title="">timezone<sub title="">minutes</sub></var>.</li>
+
+ </ol></div>
+
+
+ <h5 id=global-dates-and-times><span class=secno>2.5.5.7 </span>Global dates and times</h5>
+
<p>A <dfn id=concept-datetime title=concept-datetime>global date and time</dfn>
consists of a specific proleptic Gregorian date, consisting of a
year, a month, and a day, and a time, consisting of an hour, a
@@ -5835,39 +6061,9 @@
<li>A <a href=#valid-time-string>valid time string</a> representing the time</li>
- <li>Either:
+ <li>A <a href=#valid-time-zone-offset-string>valid time-zone offset string</a> representing the time-zone offset</li>
- <ul><li>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only
- if the time zone is UTC</li>
-
- <li>Or:
-
- <ol><li>Either a U+002B PLUS SIGN character (+) or, if the
- time-zone offset is not zero, a U+002D HYPHEN-MINUS character
- (-), representing the sign of the time-zone offset</li>
- <!-- the -00:00 offset is disallowed because RFC3339 gives it a
- special semantic -->
-
- <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
- representing the hours component <var title="">hour</var> of
- the time-zone offset, in the range 0 ≤ <var title="">hour</var> ≤ 23</li>
-
- <li>A U+003A COLON character (:)</li>
-
- <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
- representing the minutes component <var title="">minute</var>
- of the time-zone offset, in the range 0 ≤ <var title="">minute</var> ≤ 59</li>
-
- </ol></li>
-
- </ul></li>
-
- </ol><p class=note>This format allows for time-zone offsets from -23:59
- to +23:59. In practice, however, the range of offsets of actual time
- zones is -12:00 to +14:00, and the minutes component of offsets of
- actual time zones is always either 00, 30, or 45.</p>
-
- <p>Times in dates before the formation of UTC in the mid twentieth
+ </ol><p>Times in dates before the formation of UTC in the mid twentieth
century must be expressed and interpreted in terms of UT1
(contemporary Earth solar time at the 0° longitude), not UTC
(the approximation of UT1 that ticks in SI seconds). Time before the
@@ -5994,73 +6190,10 @@
<li><p>Return <var title="">time</var> and <var title="">timezone</var>.</li>
- </ol><p>The rules to <dfn id=parse-a-time-zone-offset-component>parse a time-zone offset component</dfn>, given
- an <var title="">input</var> string and a <var title="">position</var>, are as follows. This will return either
- time-zone hours and time-zone minutes, or nothing. If at any point
- the algorithm says that it "fails", this means that it is aborted at
- that point and returns nothing.</p>
-
- <ol><li>
-
- <p>If the character at <var title="">position</var> is a U+005A
- LATIN CAPITAL LETTER Z character (Z), then:</p>
-
- <ol><li><p>Let <var title="">timezone<sub title="">hours</sub></var>
- be 0.</li>
-
- <li><p>Let <var title="">timezone<sub title="">minutes</sub></var> be 0.</li>
-
- <li><p>Advance <var title="">position</var> to the next character
- in <var title="">input</var>.</li>
-
- </ol><p>Otherwise, if the character at <var title="">position</var> is
- either a U+002B PLUS SIGN (+) or a U+002D HYPHEN-MINUS (-),
- then:</p>
-
- <ol><li><p>If the character at <var title="">position</var> is a
- U+002B PLUS SIGN (+), let <var title="">sign</var> be
- "positive". Otherwise, it's a U+002D HYPHEN-MINUS (-); let <var title="">sign</var> be "negative".</li>
-
- <li><p>Advance <var title="">position</var> to the next character
- in <var title="">input</var>.</li>
-
- <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
- U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
- sequence is not exactly two characters long, then
- fail. Otherwise, interpret the resulting sequence as a base-ten
- integer. Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</li>
-
- <li>If <var title="">timezone<sub title="">hours</sub></var> is
- not a number in the range 0 ≤ <var title="">timezone<sub title="">hours</sub></var> ≤ 23, then fail.</li>
-
- <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">hours</sub></var>.</li>
-
- <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then
- fail. Otherwise, move <var title="">position</var> forwards one
- character.</li>
-
- <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
- U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
- sequence is not exactly two characters long, then
- fail. Otherwise, interpret the resulting sequence as a base-ten
- integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</li>
-
- <li>If <var title="">timezone<sub title="">minutes</sub></var> is
- not a number in the range 0 ≤ <var title="">timezone<sub title="">minutes</sub></var> ≤ 59, then fail.</li>
-
- <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">minutes</sub></var>.</li>
-
- </ol><p>Otherwise, fail.</p>
-
- </li>
-
- <li><p>Return <var title="">timezone<sub title="">hours</sub></var>
- and <var title="">timezone<sub title="">minutes</sub></var>.</li>
-
</ol></div>
- <h5 id=weeks><span class=secno>2.5.5.6 </span>Weeks</h5>
+ <h5 id=weeks><span class=secno>2.5.5.8 </span>Weeks</h5>
<p>A <dfn id=concept-week title=concept-week>week</dfn> consists of a week-year
number and a week number representing a seven-day period starting on
@@ -6155,41 +6288,413 @@
</ol></div>
- <h5 id=vaguer-moments-in-time><span class=secno>2.5.5.7 </span>Vaguer moments in time</h5>
+ <h5 id=durations><span class=secno>2.5.5.9 </span>Durations</h5>
- <p>A string is a <dfn id=valid-date-or-time-string>valid date or time string</dfn> if it is also
- one of the following:</p>
+ <p>A <dfn id=concept-duration title=concept-duration>duration</dfn> consists of
+ <!--MONTHS: either a number of months or--> a number of seconds.</p>
- <ul><li>A <a href=#valid-date-string>valid date string</a>.</li>
+ <p class=note>Since months and seconds are not comparable (a month
+ is not a precise number of seconds, but is instead a period whose
+ exact length depends on the precise day from which it is measured) a
+ <a href=#concept-duration title=concept-duration>duration</a> as defined in this
+ specification cannot <!--MONTHS: consist of a mixture of both-->
+ include months (or years, which are equivalent to twelve months).
+ Only durations that describe a specific number of seconds can be
+ described.</p>
- <li>A <a href=#valid-time-string>valid time string</a>.</li>
+ <p>A string is a <dfn id=valid-duration-string>valid duration string</dfn> representing a
+ <a href=#concept-duration title=concept-duration>duration</a> <var title="">t</var>
+ if it consists of either of the following:</p>
- <li>A <a href=#valid-global-date-and-time-string>valid global date and time string</a>.</li>
+ <ul><li>
- </ul><p>A string is a <dfn id=valid-date-or-time-string-in-content>valid date or time string in content</dfn> if
- it consists of zero or more <a href=#white_space>White_Space</a> characters,
- followed by a <a href=#valid-date-or-time-string>valid date or time string</a>, followed by
- zero or more further <a href=#white_space>White_Space</a> characters.</p>
+ <!-- The ISO format -->
- <hr><p>A string is a <dfn id=valid-date-string-with-optional-time>valid date string with optional time</dfn> if
+ <!-- NOTE: ISO durations also have a number of formats we do not
+ consider conforming:
+
+ - a "week" format (e.g. P4W). This one is actually supported
+ by the parser.
+
+ - P<date>T<time>, with or without hyphens
+
+ - All these formats, with commas instead of periods for the
+ seconds decimal
+
+ -->
+
+ <p>A literal U+0050 LATIN CAPITAL LETTER P character followed by
+ one or more of the following subcomponents, in the order given,
+ where <!--the number of years, if any, multiplied by twelve, plus
+ the number of months, if any, equals the number of months in <var
+ title="">t</var>, if the duration is in months; or, if it is in
+ seconds, -->the number of days, hours, minutes, and seconds
+ corresponds to the same number of seconds as in <var title="">t</var>:</p>
+
+ <ol><!--MONTHS:
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a U+0059
+ LATIN CAPITAL LETTER Y character, representing a number of
+ years.</p></li>
+
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a U+004D
+ LATIN CAPITAL LETTER M character, representing a number of
+ months.</p></li>
+--><li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> followed by a U+0044
+ LATIN CAPITAL LETTER D character, representing a number of
+ days.</li>
+
+ <li>
+
+ <p>A U+0054 LATIN CAPITAL LETTER T character followed by one or
+ more of the following subcomponents, in the order given:</p>
+
+ <ol><li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> followed by a
+ U+0048 LATIN CAPITAL LETTER H character, representing a number
+ of hours.</li>
+
+ <li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> followed by a
+ U+004D LATIN CAPITAL LETTER M character, representing a number
+ of minutes.</li>
+
+ <li>
+
+ <p>The following components:</p>
+
+ <ol><li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing a
+ number of seconds.</li>
+
+ <li><p>Optionally, a U+002E FULL STOP character (.) followed
+ by one or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing a
+ fraction of a second.</li>
+
+ <li><p>A U+0053 LATIN CAPITAL LETTER S character.</li>
+
+ </ol></li>
+
+ </ol></li>
+
+ </ol><p class=note>This, as with a number of other date- and
+ time-related microsyntaxes defined in this specification, is based
+ on one of the formats defined in ISO 8601. <a href=#refsISO8601>[ISO8601]</a></p>
+
+ </li>
+
+ <li>
+
+ <p>One or more <a href=#duration-time-component title="duration time component">duration time
+ components</a>, each with a different <a href=#duration-time-component-scale>duration time
+ component scale</a>, in any order; the sum of the represented
+ seconds being equal to the number of seconds in <var title="">t</var>.</p>
+
+ <p>A <dfn id=duration-time-component>duration time component</dfn> is a string consisting of
+ the following components:</p>
+
+ <ol><li><p>Zero or more <a href=#space-character title="space character">space
+ characters</a>.</li>
+
+ <li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing a
+ number of time units, scaled by the <a href=#duration-time-component-scale>duration time component
+ scale</a> specified (see below) to represent a number of
+ seconds.</li>
+
+ <li><p>If the <a href=#duration-time-component-scale>duration time component scale</a>
+ specified is 1 (i.e. the units are seconds), then, optionally, a
+ U+002E FULL STOP character (.) followed by one or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing a
+ fraction of a second.</li>
+
+ <li><p>Zero or more <a href=#space-character title="space character">space
+ characters</a>.</li>
+
+ <li>
+
+ <p>One of the following characters, representing the
+ <dfn id=duration-time-component-scale>duration time component scale</dfn> of the time unit used
+ in the numeric part of the <a href=#duration-time-component>duration time
+ component</a>:</p>
+
+ <dl><dt>U+0057 LATIN CAPITAL LETTER W character</dt>
+ <dt>U+0077 LATIN SMALL LETTER W character</dt>
+
+ <dd>Weeks. The scale is 604800.</dd>
+
+ <dt>U+0044 LATIN CAPITAL LETTER D character</dt>
+ <dt>U+0064 LATIN SMALL LETTER D character</dt>
+
+ <dd>Days. The scale is 86400.</dd>
+
+ <dt>U+0048 LATIN CAPITAL LETTER H character</dt>
+ <dt>U+0068 LATIN SMALL LETTER H character</dt>
+
+ <dd>Hours. The scale is 3600.</dd>
+
+ <dt>U+004D LATIN CAPITAL LETTER M character</dt>
+ <dt>U+006D LATIN SMALL LETTER M character</dt>
+
+ <dd>Minutes. The scale is 60.</dd>
+
+ <dt>U+0053 LATIN CAPITAL LETTER S character</dt>
+ <dt>U+0073 LATIN SMALL LETTER S character</dt>
+
+ <dd>Seconds. The scale is 1.</dd>
+
+ </dl></li>
+
+ <li><p>Zero or more <a href=#space-character title="space character">space
+ characters</a>.</li>
+
+ </ol><p class=note>This is not based on any of the formats in ISO
+ 8601. It is intended to be a more human-readable alternative to
+ the ISO 8601 duration format.</p>
+
+ </li>
+
+ </ul><div class=impl>
+
+ <p>The rules to <dfn id=parse-a-duration-string>parse a duration string</dfn> are as follows.
+ This will return either a <a href=#concept-duration title=concept-duration>duration</a> or nothing. If at any point
+ the algorithm says that it "fails", this means that it is aborted at
+ that point and returns nothing.</p>
+
+ <ol><!--MONTHS: this algorithm actually already parses months
+ adequately, though it would need tweaking if we introduced a "mo"
+ unit for the non-ISO variant. See other "MONTHS" annotations below. --><li><p>Let <var title="">input</var> be the string being
+ parsed.</li>
+
+ <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
+ string.</li>
+
+ <li><p>Let <var title="">months</var>, <var title="">seconds</var>,
+ and <var title="">component count</var> all be zero.</li>
+
+ <li>
+
+ <p>Let <var title="">M-disambiguator</var> be <i>minutes</i>.</p>
+
+ <!--MONTHS: this note would change-->
+ <p class=note>This flag's othe value is <i>months</i>. It is
+ used to disambiguate the "M" unit in ISO8601 durations, which use
+ the same unit for months and minutes. Months are not allowed, but
+ are parsed for future compatibility and to avoid misinterpreting
+ ISO8601 durations that would be valid in other contexts.</p>
+
+ </li>
+
+ <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then fail.</li>
+
+ <li><p>If the character in <var title="">input</var> pointed to by
+ <var title="">position</var> is a U+0050 LATIN CAPITAL LETTER P
+ character, then advance <var title="">position</var> to the next
+ character, set <var title="">M-disambiguator</var> to
+ <i>months</i>, and <a href=#skip-whitespace>skip whitespace</a>.</li>
+
+ <li>
+
+ <p>Run the following substeps in a loop, until the first step in
+ the loop requires that the loop be broken, or until a step
+ requiring the algorithm to fail is reached:</p>
+
+ <ol><li><p>Let <var title="">units</var> be undefined. It will be
+ assigned one of the following values: <i>years</i>,
+ <i>months</i>, <i>weeks</i>, <i>days</i>, <i>hours</i>,
+ <i>minutes</i>, and <i>seconds</i>.</li>
+
+ <li><p>Let <var title="">next character</var> be undefined. It is
+ used to process characters from the <var title="">input</var>.</li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then break the loop.</li>
+
+ <li><p>If the character in <var title="">input</var> pointed to
+ by <var title="">position</var> is a U+0054 LATIN CAPITAL LETTER
+ T character, then advance <var title="">position</var> to the
+ next character, set <var title="">M-disambiguator</var> to
+ <i>minutes</i>, <a href=#skip-whitespace>skip whitespace</a>, and return to the
+ top of the loop.</li>
+
+ <li><p>Set <var title="">next character</var> to the character in
+ <var title="">input</var> pointed to by <var title="">position</var>.</li>
+
+ <li>
+
+ <p>If <var title="">next character</var> is a U+002E FULL STOP
+ character (.), then let <var title="">N</var> equal zero. (Do
+ not advance <var title="">position</var>. That is taken care of
+ below.)</p>
+
+ <p>Otherwise, if <var title="">next character</var> is a
+ character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
+ NINE (9), then <a href=#collect-a-sequence-of-characters>collect a sequence of characters</a> in
+ the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
+ interpret the resulting sequence as a base-ten integer, and let
+ <var title="">N</var> be that number.</p>
+
+ <p>Otherwise <var title="">next character</var> is not part of a
+ number; fail.</p>
+
+ </li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then fail.</li>
+
+ <li><p>Set <var title="">next character</var> to the character in
+ <var title="">input</var> pointed to by <var title="">position</var>, and this time advance <var title="">position</var> to the next character. (If <var title="">next character</var> was a U+002E FULL STOP character
+ (.) before, it will still be that character this time.)</li>
+
+ <li>
+
+ <p>If <var title="">next character</var> is a U+002E FULL STOP
+ character (.), then run these substeps:</p>
+
+ <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the
+ range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). Let <var title="">s</var> be the resulting sequence.</li>
+
+ <li><p>If <var title="">s</var> is the empty string, then
+ fail.</li>
+
+ <li><p>Let <var title="">length</var> be the number of
+ characters in <var title="">s</var>.</li>
+
+ <li><p>Let <var title="">fraction</var> be the result of
+ interpreting <var title="">s</var> as a base-ten integer, and
+ then dividing that number by <span title="">10<sup title=""><var title="">length</var></sup></span>.</li>
+
+ <li><p>Increment <var title="">N</var> by <var title="">fraction</var>.</li>
+
+ <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then fail.</li>
+
+ <li><p>Set <var title="">next character</var> to the character
+ in <var title="">input</var> pointed to by <var title="">position</var>, and advance <var title="">position</var> to the next character.</li>
+
+ <li><p>If <var title="">next character</var> is neither a
+ U+0053 LATIN CAPITAL LETTER S character nor a U+0073 LATIN
+ SMALL LETTER S character, then fail.</li>
+
+ <li><p>Set <var title="">units</var> to <i>seconds</i>.</li>
+
+ </ol><p>Otherwise, run these substeps:</p>
+
+ <ol><li><p>If <var title="">next character</var> is a <a href=#space-character>space
+ character</a>, then <a href=#skip-whitespace>skip whitespace</a>, set <var title="">next character</var> to the character in <var title="">input</var> pointed to by <var title="">position</var>, and advance <var title="">position</var> to the next character.</li>
+
+ <li>
+
+ <!--MONTHS: this would probably be where we would add more
+ logic to support a new unit like 'mo' -->
+
+ <p>If <var title="">next character</var> is a U+0059 LATIN
+ CAPITAL LETTER Y character, or a U+0079 LATIN SMALL LETTER Y
+ character, set <var title="">units</var> to <i>years</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>months</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+004D LATIN
+ CAPITAL LETTER M character or a U+006D LATIN SMALL LETTER M
+ character, and <var title="">M-disambiguator</var> is
+ <i>months</i>, then set <var title="">units</var> to
+ <i>months</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0057 LATIN
+ CAPITAL LETTER W character or a U+0077 LATIN SMALL LETTER W
+ character, set <var title="">units</var> to <i>weeks</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0044 LATIN
+ CAPITAL LETTER D character or a U+0064 LATIN SMALL LETTER D
+ character, set <var title="">units</var> to <i>days</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0048 LATIN
+ CAPITAL LETTER H character or a U+0068 LATIN SMALL LETTER H
+ character, set <var title="">units</var> to <i>hours</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+004D LATIN
+ CAPITAL LETTER M character or a U+006D LATIN SMALL LETTER M
+ character, and <var title="">M-disambiguator</var> is
+ <i>minutes</i>, then set <var title="">units</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0053 LATIN
+ CAPITAL LETTER S character or a U+0073 LATIN SMALL LETTER S
+ character, set <var title="">units</var> to <i>seconds</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>Otherwise if <var title="">next character</var> is none of
+ the above characters, then fail.</p>
+
+ </li>
+
+ </ol></li>
+
+ <li><p>Increment <var title="">component count</var>.</li>
+
+ <li><p>Let <var title="">multiplier</var> be 1.</li>
+
+ <li><p>If <var title="">units</var> is <i>years</i>, multiply
+ <var title="">multiplier</var> by 12 and set <var title="">units</var> to <i>months</i>.</li>
+
+ <li>
+
+ <p>If <var title="">units</var> is <i>months</i>, add the
+ product of <var title="">N</var> and <var title="">multiplier</var> to <var title="">months</var>.</p>
+
+ <p>Otherwise, run these substeps:</p>
+
+ <ol><li><p>If <var title="">units</var> is <i>weeks</i>, multiply
+ <var title="">multiplier</var> by 7 and set <var title="">units</var> to <i>days</i>.</li>
+
+ <li><p>If <var title="">units</var> is <i>days</i>, multiply
+ <var title="">multiplier</var> by 24 and set <var title="">units</var> to <i>hours</i>.</li>
+
+ <li><p>If <var title="">units</var> is <i>hours</i>, multiply
+ <var title="">multiplier</var> by 60 and set <var title="">units</var> to <i>minutes</i>.</li>
+
+ <li><p>If <var title="">units</var> is <i>minutes</i>, multiply
+ <var title="">multiplier</var> by 60 and set <var title="">units</var> to <i>seconds</i>.</li>
+
+ <li><p>Forcibly, <var title="">units</var> is now
+ <i>seconds</i>. Add the product of <var title="">N</var> and
+ <var title="">multiplier</var> to <var title="">seconds</var>.</li>
+
+ </ol></li>
+
+ <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
+
+ </ol></li>
+
+ <li><p>If <var title="">component count</var> is zero,
+ fail.</li>
+
+ <!--MONTHS: if we add month support this is where you'd return them-->
+ <li><p>If <var title="">months</var> is not zero, fail.</li>
+
+ <li><p>Return the <a href=#concept-duration title=concept-duration>duration</a>
+ consisting of <var title="">seconds</var> seconds.</li>
+
+ </ol></div>
+
+
+ <h5 id=vaguer-moments-in-time><span class=secno>2.5.5.10 </span>Vaguer moments in time</h5>
+
+ <p>A string is a <dfn id=valid-date-string-with-optional-time>valid date string with optional time</dfn> if
it is also one of the following:</p>
<ul><li>A <a href=#valid-date-string>valid date string</a>.</li>
<li>A <a href=#valid-global-date-and-time-string>valid global date and time string</a>.</li>
- </ul><p>A string is a <dfn id=valid-date-string-in-content-with-optional-time>valid date string in content with optional
- time</dfn> if it consists of zero or more <a href=#white_space>White_Space</a>
- characters, followed by a <a href=#valid-date-string-with-optional-time>valid date string with optional
- time</a>, followed by zero or more further
- <a href=#white_space>White_Space</a> characters.</p>
+ </ul><div class=impl>
- <div class=impl>
-
<hr><p>The rules to <dfn id=parse-a-date-or-time-string>parse a date or time string</dfn> are as
- follows. The algorithm is invoked with a flag indicating if the
- <i>in attribute</i> variant or the <i>in content</i> variant is to
- be used. The algorithm will return either a <a href=#concept-date title=concept-date>date</a>, a <a href=#concept-time title=concept-time>time</a>, a <a href=#concept-datetime title=concept-datetime>global date and time</a>, or nothing. If
+ follows. The algorithm will return either a <a href=#concept-date title=concept-date>date</a>, a <a href=#concept-time title=concept-time>time</a>, a <a href=#concept-datetime title=concept-datetime>global date and time</a>, or nothing. If
at any point the algorithm says that it "fails", this means that it
is aborted at that point and returns nothing.</p>
@@ -6199,9 +6704,6 @@
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
string.</li>
- <li><p>For the <i>in content</i> variant: <a href=#skip-white_space-characters>skip White_Space
- characters</a>.</li>
-
<li><p>Set <var title="">start position</var> to the same position
as <var title="">position</var>.</li>
@@ -6235,9 +6737,6 @@
time-zone offset component</a> to obtain <var title="">timezone<sub title="">hours</sub></var> and <var title="">timezone<sub title="">minutes</sub></var>. If this returns
nothing, then fail.</p>
- <li><p>For the <i>in content</i> variant: <a href=#skip-white_space-characters>skip White_Space
- characters</a>.</li>
-
<li><p>If <var title="">position</var> is <em>not</em> beyond the
end of <var title="">input</var>, then fail.</li>
@@ -7836,7 +8335,7 @@
<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
characters that immediately follow the word "<code title="">charset</code>" (there might not be any).</li>
- <li><p>If the next character is not a U+003D EQUALS SIGN ('='),
+ <li><p>If the next character is not a U+003D EQUALS SIGN (=),
then move <var title="">position</var> to point just before that
next character, and jump back to the step labeled
<i>loop</i>.</li>
@@ -7849,12 +8348,12 @@
<p>Process the next character as follows:</p>
- <dl class=switch><dt>If it is a U+0022 QUOTATION MARK ('"') and there is a later U+0022 QUOTATION MARK ('"') in <var title="">s</var></dt>
- <dt>If it is a U+0027 APOSTROPHE ("'") and there is a later U+0027 APOSTROPHE ("'") in <var title="">s</var></dt>
+ <dl class=switch><dt>If it is a U+0022 QUOTATION MARK (") and there is a later U+0022 QUOTATION MARK (") in <var title="">s</var></dt>
+ <dt>If it is a U+0027 APOSTROPHE (') and there is a later U+0027 APOSTROPHE (') in <var title="">s</var></dt>
<dd>Return the encoding corresponding to the string between this character and the next earliest occurrence of this character.</dd>
- <dt>If it is an unmatched U+0022 QUOTATION MARK ('"')</dt>
- <dt>If it is an unmatched U+0027 APOSTROPHE ("'")</dt>
+ <dt>If it is an unmatched U+0022 QUOTATION MARK (")</dt>
+ <dt>If it is an unmatched U+0027 APOSTROPHE (')</dt>
<dt>If there is no next character</dt>
<dd>Return nothing.</dd>
@@ -11563,6 +12062,7 @@
<li><code><a href=#svg>svg</a></code></li>
<li><code><a href=#the-table-element>table</a></code></li>
<li><code><a href=#the-textarea-element>textarea</a></code></li>
+ <li><code><a href=#the-time-element>time</a></code></li>
<li><code><a href=#the-u-element>u</a></code></li>
<li><code><a href=#the-ul-element>ul</a></code></li>
<li><code><a href=#the-var-element>var</a></code></li>
@@ -11663,6 +12163,7 @@
<li><code><a href=#the-sub-and-sup-elements>sup</a></code></li>
<li><code><a href=#svg>svg</a></code></li>
<li><code><a href=#the-textarea-element>textarea</a></code></li>
+ <li><code><a href=#the-time-element>time</a></code></li>
<li><code><a href=#the-u-element>u</a></code></li>
<li><code><a href=#the-var-element>var</a></code></li>
<li><code><a href=#the-video-element>video</a></code></li>
@@ -11970,6 +12471,7 @@
<li><code><a href=#svg>svg</a></code></li>
<li><code><a href=#the-table-element>table</a></code></li>
<li><code><a href=#the-textarea-element>textarea</a></code></li>
+ <li><code><a href=#the-time-element>time</a></code></li>
<li><code><a href=#the-u-element>u</a></code></li>
<li><code><a href=#the-ul-element>ul</a></code> (if the element's children include at least one <code><a href=#the-li-element>li</a></code> element)</li>
<li><code><a href=#the-var-element>var</a></code></li>
@@ -14588,8 +15090,9 @@
page.</li>
<li><p>If the character in <var title="">input</var> pointed to
- by <var title="">position</var> is a U+003B SEMICOLON ("<code title="">;</code>"), then advance <var title="">position</var> to
- the next character. Otherwise, jump to the last step.</li>
+ by <var title="">position</var> is a U+003B SEMICOLON (;), then
+ advance <var title="">position</var> to the next character.
+ Otherwise, jump to the last step.</li>
<li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
@@ -14614,8 +15117,9 @@
<li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
<li><p>If the character in <var title="">input</var> pointed to
- by <var title="">position</var> is a U+003D EQUALS SIGN ("<code title="">=</code>"), then advance <var title="">position</var> to
- the next character. Otherwise, jump to the last step.</li>
+ by <var title="">position</var> is a U+003D EQUALS SIGN (=), then
+ advance <var title="">position</var> to the next character.
+ Otherwise, jump to the last step.</li>
<li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
@@ -17026,7 +17530,7 @@
<em>...more content...</em>
</div>
<footer>
- <p>Posted <data itemprop="datePublished" value="2009-10-10">Thursday</data>.</p>
+ <p>Posted <time itemprop="datePublished" datetime="2009-10-10">Thursday</time>.</p>
</footer>
</article>
<em>...more blog posts...</em>
@@ -17178,7 +17682,7 @@
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 itemprop="headline">The Very First Rule of Life</h1>
- <p><data itemprop="datePublished" value="2009-10-09">3 days ago</data></p>
+ <p><time itemprop="datePublished" datetime="2009-10-09">3 days ago</time></p>
<link itemprop="url" href="?comments=0">
</header>[
<p>If there's a microphone anywhere near you, assume it's hot and
@@ -17194,7 +17698,7 @@
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 itemprop="headline">The Very First Rule of Life</h1>
- <p><data itemprop="datePublished" value="2009-10-09">3 days ago</data></p>
+ <p><time itemprop="datePublished" datetime="2009-10-09">3 days ago</time></p>
<link itemprop="url" href="?comments=0">
</header>
<p>If there's a microphone anywhere near you, assume it's hot and
@@ -17208,7 +17712,7 @@
<p>Posted by: <span itemprop="creator" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">George Washington</span>
</span></p>
- <p><data itemprop="commentTime" value="2009-10-10">15 minutes ago</data></p>
+ <p><time itemprop="commentTime" datetime="2009-10-10">15 minutes ago</time></p>
</footer>
<p>Yeah! Especially when talking about your lobbyist friends!</p>
</article>
@@ -17218,7 +17722,7 @@
<p>Posted by: <span itemprop="creator" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">George Hammond</span>
</span></p>
- <p><data itemprop="commentTime" value="2009-10-10">5 minutes ago</data></p>
+ <p><time itemprop="commentTime" datetime="2009-10-10">5 minutes ago</time></p>
</footer>
<p>Hey, you have the same first name as me.</p>
</article>
@@ -17695,7 +18199,7 @@
<P><A HREF="/fm/015.ogv">Download video</A>.</P>
</VIDEO>
<FOOTER> <!-- footer for article -->
- <P>Published <DATA VALUE="2009-10-21T18:26-07:00">on 2009/10/21 at 6:26pm</DATA></P>
+ <P>Published <TIME DATETIME="2009-10-21T18:26-07:00">on 2009/10/21 at 6:26pm</TIME></P>
</FOOTER>
</ARTICLE>
<ARTICLE>
@@ -17704,7 +18208,7 @@
<P>It is fun to see them pull some coal cars because they look so
dwarfed in comparison.</P>
<FOOTER> <!-- footer for article -->
- <P>Published <DATA VALUE="2009-09-15T14:54-07:00">on 2009/09/15 at 2:54pm</DATA></P>
+ <P>Published <TIME DATETIME="2009-09-15T14:54-07:00">on 2009/09/15 at 2:54pm</TIME></P>
</FOOTER>
</ARTICLE>
<FOOTER> <!-- site wide footer -->
@@ -20525,6 +21029,9 @@
attribute must be present. Its value must be a representation of the
element's contents in a machine-readable format.</p>
+ <p class=note>When the value is date- or time-related, the more
+ specific <code><a href=#the-time-element>time</a></code> element can be used instead.</p>
+
<p>The element can be used for several purposes.</p>
<p>When combined with microformats or the <a href=#microdata>microdata attributes</a> defined in this
@@ -20551,16 +21058,255 @@
<div class=example>
- <p>The <code><a href=#the-data-element>data</a></code> element can be used to encode dates, for
+ <p>Here, a short table has its numeric values encoded using
+ <code><a href=#the-data-element>data</a></code> so that a script can provide a sorting mechanism
+ on each column, despite the numbers being presented in textual
+ form in one column and in a decomposed form in another.</p>
+
+ <pre><table class="sortable"> <!-- class used by script to find tables to which to add sorting controls -->
+ <thead> <tr> <th> Game <th> Corporations <th> Map Size
+ <tbody>
+ <tr> <td> 1830 <td> <data value="8">Eight</data> <td> <data value="93">19+74 hexes (93 total)</data>
+ <tr> <td> 1856 <td> <data value="11">Eleven</data> <td> <data value="99">12+87 hexes (99 total)</data>
+ <tr> <td> 1870 <td> <data value="10">Ten</data> <td> <data value="149">4+145 hexes (149 total)</data>
+</table></pre>
+
+ </div>
+
+
+
+
+ <h4 id=the-time-element><span class=secno>4.6.11 </span>The <dfn><code>time</code></dfn> element</h4>
+
+ <dl class=element><dt>Categories</dt>
+ <dd><a href=#flow-content>Flow content</a>.</dd>
+ <dd><a href=#phrasing-content>Phrasing content</a>.</dd>
+ <dd><a href=#palpable-content>Palpable content</a>.</dd>
+ <dt>Contexts in which this element can be used:</dt>
+ <dd>Where <a href=#phrasing-content>phrasing content</a> is expected.</dd>
+ <dt>Content model:</dt>
+ <dd><a href=#phrasing-content>Phrasing content</a>.</dd>
+ <dt>Content attributes:</dt>
+ <dd><a href=#global-attributes>Global attributes</a></dd>
+ <dd><code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code></dd>
+ <dt>DOM interface:</dt>
+ <dd>
+<pre class=idl>interface <dfn id=htmltimeelement>HTMLTimeElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
+ attribute DOMString <a href=#dom-time-datetime title=dom-time-datetime>datetime</a>;
+};</pre>
+ </dd>
+ </dl><p>The <code><a href=#the-time-element>time</a></code> element <a href=#represents>represents</a> its
+ contents, along with a machine-readable form of those contents in
+ the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute. The
+ kind of content is limited to various kinds of dates, times,
+ time-zone offsets, and durations, as described below.</p>
+
+ <p>The <dfn id=attr-time-datetime title=attr-time-datetime><code>datetime</code></dfn>
+ attribute may be present. If present, its value must be a
+ representation of the element's contents in a machine-readable
+ format.</p>
+
+ <p>A <code><a href=#the-time-element>time</a></code> element that does not have a <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content attribute must
+ not have any element descendants.</p>
+
+ <p>The <dfn id=datetime-value>datetime value</dfn> of a <code><a href=#the-time-element>time</a></code> element is
+ the value of the element's <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content attribute, if
+ it has one, or the element's <code><a href=#textcontent>textContent</a></code>, if it does
+ not.</p>
+
+ <p>The <a href=#datetime-value>datetime value</a> of a <code><a href=#the-time-element>time</a></code> element
+ must match one of the following syntaxes.</p>
+
+ <dl><dt>A <a href=#valid-month-string>valid month string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-11</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-date-string>valid date string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-11-12</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-yearless-date-string>valid yearless date string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>11-12</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-time-string>valid time string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>14:54</time></pre>
+ <pre class=example><time>14:54:39</time></pre>
+ <pre class=example><time>14:54:39.92922</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-local-date-and-time-string>valid local date and time string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-11-12T14:54</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39.92922</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-time-zone-offset-string>valid time-zone offset string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>Z</time></pre>
+ <pre class=example><time>+00:00</time></pre>
+ <pre class=example><time>-08:00</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-global-date-and-time-string>valid global date and time string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-11-12T14:54Z</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39Z</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39.92922Z</time></pre>
+ <pre class=example><time>2011-11-12T14:54+00:00</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39+00:00</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39.92922+00:00</time></pre>
+ <pre class=example><time>2011-11-12T06:54-08:00</time></pre>
+ <pre class=example><time>2011-11-12T06:54:39-08:00</time></pre>
+ <pre class=example><time>2011-11-12T06:54:39.92922-08:00</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-week-string>valid week string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-W46</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-non-negative-integer>valid non-negative integer</a> representing a year</dt>
+
+ <dd>
+
+ <pre class=example><time>2011</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-duration-string>valid duration string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>PT4H18M3S</time></pre>
+
+ <pre class=example><time>4h 18m 3s</time></pre>
+
+ </dd>
+
+ </dl><div class=impl>
+
+ <p>The machine-readable equivalent of the element's contents must be
+ obtained from the element's <a href=#datetime-value>datetime value</a> by using the
+ following algorithm:</p>
+
+ <ol><li><p>If <a href=#parse-a-month-string title="parse a month string">parsing a month
+ string</a> from the element's <a href=#datetime-value>datetime value</a>, if
+ The machine-readable equivalent is the <a href=#concept-month title=concept-month>month</a>, that is the machine-readable
+ equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-date-string title="parse a date string">parsing a date
+ string</a> from the element's <a href=#datetime-value>datetime value</a>, if
+ The machine-readable equivalent is the <a href=#concept-date title=concept-date>date</a>, that is the machine-readable
+ equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-yearless-date-string title="parse a yearless date string">parsing a
+ yearless date string</a> from the element's <a href=#datetime-value>datetime
+ value</a> returns a <a href=#concept-yearless-date title=concept-yearless-date>yearless date</a>, that is the
+ machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-time-string title="parse a time string">parsing a time
+ string</a> from the element's <a href=#datetime-value>datetime value</a>,
+ returns a <a href=#concept-time title=concept-time>time</a>, that is the
+ machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-local-date-and-time-string title="parse a local date and time string">parsing
+ a local date and time string</a> from the element's
+ <a href=#datetime-value>datetime value</a> returns a <a href=#concept-datetime-local title=concept-datetime-local>local date and time</a>, that is
+ the machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-time-zone-offset-string title="parse a time-zone offset string">parsing a
+ time-zone offset string</a> from the element's <a href=#datetime-value>datetime
+ value</a>, returns a <a href=#concept-timezone title=concept-timezone>time-zone
+ offset</a>, that is the machine-readable equivalent; abort
+ these steps.</li>
+
+ <li><p>If <a href=#parse-a-global-date-and-time-string title="parse a global date and time
+ string">parsing a global date and time string</a> from the
+ element's <a href=#datetime-value>datetime value</a> returns a <a href=#concept-datetime title=concept-datetime>global date and time</a>, that is the
+ machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-week-string title="parse a week string">parsing a week
+ string</a> from the element's <a href=#datetime-value>datetime value</a>,
+ returns a <a href=#concept-week title=concept-week>week</a>, that is the
+ machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If the element's <a href=#datetime-value>datetime value</a> consists of
+ only characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
+ NINE (9), then the machine-readable equivalent is the base-ten
+ interpretation of those digits, representing a year; abort these
+ steps.</li>
+
+ <li><p>If <a href=#parse-a-duration-string title="parse a duration string">parsing a duration
+ string</a> from the element's <a href=#datetime-value>datetime value</a>,
+ returns a <a href=#concept-duration title=concept-duration>duration</a>, that is
+ the machine-readable equivalent; abort these steps.</li>
+
+ <li><p>There is no machine-readable equivalent.</li>
+
+ </ol><p class=note>The algorithms referenced above are intended to be
+ designed such that for any arbitrary string <var title="">s</var>,
+ only one of the algorithms returns a value. A more efficient
+ approach might be to create a single algorithm that parses all these
+ data types in one pass; developing such an algorithm is left as an
+ exercise to the reader.</p>
+
+ <p>The <dfn id=dom-time-datetime title=dom-time-datetime><code>datetime</code></dfn>
+ IDL attribute must <a href=#reflect>reflect</a> the content attribute of the
+ same name.</p>
+
+ </div>
+
+ <div class=example>
+
+ <p>The <code><a href=#the-time-element>time</a></code> element can be used to encode dates, for
example in microformats. The following shows a hypothetical way of
encoding an event using a variant on hCalendar that uses the
- <code><a href=#the-data-element>data</a></code> element:</p>
+ <code><a href=#the-time-element>time</a></code> element:</p>
<pre><div class="vevent">
<a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
<span class="summary">Web 2.0 Conference</span>:
- <data class="dtstart" value="2007-10-05">October 5</data> -
- <data class="dtend" value="2007-10-20">19</data>,
+ <time class="dtstart" datetime="2007-10-05">October 5</time> -
+ <time class="dtend" datetime="2007-10-20">19</time>,
at the <span class="location">Argent Hotel, San Francisco, CA</span>
</div></pre>
@@ -20573,12 +21319,12 @@
<div class=example>
<p>In this example, an article's publication date is marked up
- using <code><a href=#the-data-element>data</a></code> and the schema.org microdata
+ using <code><a href=#the-time-element>time</a></code> and the schema.org microdata
vocabulary:</p>
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<h1 itemprop="headline">Small tasks</h1>
- <footer>Published <data itemprop="datePublished" value="2009-08-30">yesterday</data>.</footer>
+ <footer>Published <time itemprop="datePublished" datetime="2009-08-30">yesterday</time>.</footer>
<p itemprop="articleBody">I put a bike bell on his bike.</p>
</article></pre>
@@ -20586,45 +21332,48 @@
<div class=example>
- <p>In the following snippet, the <code><a href=#the-data-element>data</a></code> element is used
+ <p>In the following snippet, the <code><a href=#the-time-element>time</a></code> element is used
to encode a date in the ISO8601 format, for later processing by a
script:</p>
- <pre><p>Our first date was <data value="2006-09-23">a Saturday</data>.</p></pre>
+ <pre><p>Our first date was <time datetime="2006-09-23">a Saturday</time>.</p></pre>
<p>In this second snippet, the value includes a time:</p>
- <pre><p>We stopped talking at <data value="2006-09-24T05:00-07:00">5am the next morning</data>.</p></pre>
+ <pre><p>We stopped talking at <time datetime="2006-09-24T05:00-07:00">5am the next morning</time>.</p></pre>
<p>A script loaded by the page (and thus privy to the page's
internal convention of marking up dates and times using the
- <code><a href=#the-data-element>data</a></code> element) could scan through the page and look at
- all the <code><a href=#the-data-element>data</a></code> elements therein to create an index of
+ <code><a href=#the-time-element>time</a></code> element) could scan through the page and look at
+ all the <code><a href=#the-time-element>time</a></code> elements therein to create an index of
dates and times.</p>
</div>
<div class=example>
- <p>Here, a short table has its numeric values encoded using
- <code><a href=#the-data-element>data</a></code> so that a script can provide a sorting mechanism
- on each column, despite the numbers being presented in textual
- form in one column and in a decomposed form in another.</p>
+ <p>For example, this element conveys the string "Tuesday" with
+ the additional semantic that the 12th of November 2011 is the
+ meaning that corresponds to "Tuesday":</p>
- <pre><table class="sortable"> <!-- class used by script to find tables to which to add sorting controls -->
- <thead> <tr> <th> Game <th> Corporations <th> Map Size
- <tbody>
- <tr> <td> 1830 <td> <data value="8">Eight</data> <td> <data value="93">19+74 hexes (93 total)</data>
- <tr> <td> 1856 <td> <data value="11">Eleven</data> <td> <data value="99">12+87 hexes (99 total)</data>
- <tr> <td> 1870 <td> <data value="10">Ten</data> <td> <data value="149">4+145 hexes (149 total)</data>
-</table></pre>
+ <pre>Today is <time datetime="2011-11-12">Tuesday</time>.</pre>
</div>
+ <div class=example>
+ <p>In this example, a specific time in the Pacific Standard Time
+ timezone is specified:</p>
- <h4 id=the-code-element><span class=secno>4.6.11 </span>The <dfn><code>code</code></dfn> element</h4>
+ <pre>Your next meeting is at <time datetime="2011-11-12T15:00-08:00">3pm</time>.</pre>
+ </div>
+
+
+
+
+ <h4 id=the-code-element><span class=secno>4.6.12 </span>The <dfn><code>code</code></dfn> element</h4>
+
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
<dd><a href=#phrasing-content>Phrasing content</a>.</dd>
@@ -20686,7 +21435,7 @@
<p class=note>See the <code><a href=#the-pre-element>pre</a></code> element for more details.</p>
- <h4 id=the-var-element><span class=secno>4.6.12 </span>The <dfn><code>var</code></dfn> element</h4>
+ <h4 id=the-var-element><span class=secno>4.6.13 </span>The <dfn><code>var</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20757,7 +21506,7 @@
</div>
- <h4 id=the-samp-element><span class=secno>4.6.13 </span>The <dfn><code>samp</code></dfn> element</h4>
+ <h4 id=the-samp-element><span class=secno>4.6.14 </span>The <dfn><code>samp</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20796,7 +21545,7 @@
</div>
- <h4 id=the-kbd-element><span class=secno>4.6.14 </span>The <dfn><code>kbd</code></dfn> element</h4>
+ <h4 id=the-kbd-element><span class=secno>4.6.15 </span>The <dfn><code>kbd</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20848,7 +21597,7 @@
</div>
- <h4 id=the-sub-and-sup-elements><span class=secno>4.6.15 </span>The <dfn id=the-sub-element><code>sub</code></dfn> and <dfn id=the-sup-element><code>sup</code></dfn> elements</h4>
+ <h4 id=the-sub-and-sup-elements><span class=secno>4.6.16 </span>The <dfn id=the-sub-element><code>sub</code></dfn> and <dfn id=the-sup-element><code>sup</code></dfn> elements</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20911,7 +21660,7 @@
- <h4 id=the-i-element><span class=secno>4.6.16 </span>The <dfn><code>i</code></dfn> element</h4>
+ <h4 id=the-i-element><span class=secno>4.6.17 </span>The <dfn><code>i</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20972,7 +21721,7 @@
necessarily be italicized.</p>
- <h4 id=the-b-element><span class=secno>4.6.17 </span>The <dfn><code>b</code></dfn> element</h4>
+ <h4 id=the-b-element><span class=secno>4.6.18 </span>The <dfn><code>b</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21048,7 +21797,7 @@
- <h4 id=the-u-element><span class=secno>4.6.18 </span>The <dfn><code>u</code></dfn> element</h4>
+ <h4 id=the-u-element><span class=secno>4.6.19 </span>The <dfn><code>u</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21088,7 +21837,7 @@
- <h4 id=the-mark-element><span class=secno>4.6.19 </span>The <dfn><code>mark</code></dfn> element</h4>
+ <h4 id=the-mark-element><span class=secno>4.6.20 </span>The <dfn><code>mark</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21237,7 +21986,7 @@
</div>
- <h4 id=the-ruby-element><span class=secno>4.6.20 </span>The <dfn><code>ruby</code></dfn> element</h4>
+ <h4 id=the-ruby-element><span class=secno>4.6.21 </span>The <dfn><code>ruby</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21317,7 +22066,7 @@
<!-- Note: Examples are 32px/16px Stone Sans Sem ITC TT -->
- <h4 id=the-rt-element><span class=secno>4.6.21 </span>The <dfn><code>rt</code></dfn> element</h4>
+ <h4 id=the-rt-element><span class=secno>4.6.22 </span>The <dfn><code>rt</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd>None.</dd>
@@ -21347,7 +22096,7 @@
</div>
- <h4 id=the-rp-element><span class=secno>4.6.22 </span>The <dfn><code>rp</code></dfn> element</h4>
+ <h4 id=the-rp-element><span class=secno>4.6.23 </span>The <dfn><code>rp</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd>None.</dd>
@@ -21396,7 +22145,7 @@
</div>
- <h4 id=the-bdi-element><span class=secno>4.6.23 </span>The <dfn><code>bdi</code></dfn> element</h4>
+ <h4 id=the-bdi-element><span class=secno>4.6.24 </span>The <dfn><code>bdi</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21461,7 +22210,7 @@
</div>
- <h4 id=the-bdo-element><span class=secno>4.6.24 </span>The <dfn><code>bdo</code></dfn> element</h4>
+ <h4 id=the-bdo-element><span class=secno>4.6.25 </span>The <dfn><code>bdo</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21512,7 +22261,7 @@
- <h4 id=the-span-element><span class=secno>4.6.25 </span>The <dfn><code>span</code></dfn> element</h4>
+ <h4 id=the-span-element><span class=secno>4.6.26 </span>The <dfn><code>span</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21552,7 +22301,7 @@
- <h4 id=the-br-element><span class=secno>4.6.26 </span>The <dfn><code>br</code></dfn> element</h4>
+ <h4 id=the-br-element><span class=secno>4.6.27 </span>The <dfn><code>br</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21634,7 +22383,7 @@
</div>
- <h4 id=the-wbr-element><span class=secno>4.6.27 </span>The <dfn><code>wbr</code></dfn> element</h4>
+ <h4 id=the-wbr-element><span class=secno>4.6.28 </span>The <dfn><code>wbr</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21685,7 +22434,7 @@
- <h4 id=usage-summary><span class=secno>4.6.28 </span>Usage summary</h4>
+ <h4 id=usage-summary><span class=secno>4.6.29 </span>Usage summary</h4>
<p><i>This section is non-normative.</i></p>
@@ -21732,6 +22481,10 @@
<td>Machine-readable equivalent
<td><pre class=example>Available starting today! <strong><data value="UPC:022014640201">North Coast Organic Apple Cider</data></strong></pre>
+ <tr><td><code><a href=#the-time-element>time</a></code>
+ <td>Machine-readable equivalent of date- or time-related data
+ <td><pre class=example>Available starting on <strong><time datetime="2011-11-12">November 12th</time></strong>!</pre>
+
<tr><td><code><a href=#the-code-element>code</a></code>
<td>Computer code
<td><pre class=example>The <strong><code>fruitdb</code></strong> program can be used for tracking fruit production.</pre>
@@ -56696,7 +57449,14 @@
<p>The following extract shows how an IM conversation log could be
marked up, using the <code><a href=#the-data-element>data</a></code> element to provide Unix
- timestamps for each line.</p>
+ timestamps for each line. Note that the timestamps are provided in
+ a format that the <code><a href=#the-time-element>time</a></code> element does not support, so
+ the <code><a href=#the-data-element>data</a></code> element is used instead (namely, Unix <code title="">time_t</code> timestamps). Had the author wished to mark
+ up the data using one of the date and time formats supported by the
+ <code><a href=#the-time-element>time</a></code> element, that element could have been used
+ instead of <code><a href=#the-data-element>data</a></code>. This could be advantageous as it
+ would allow data analysis tools to detect the timestamps
+ unambiguously, without coordination with the page author.</p>
<pre><p> <data value="1319898155">14:22</data> <b>egof</b> I'm not that nerdy, I've only seen 30% of the star trek episodes
<p> <data value="1319898192">14:23</data> <b>kaj</b> if you know what percentage of the star trek episodes you have seen, you are inarguably nerdy
@@ -57449,11 +58209,27 @@
<div class=example>
+ <p>Here, there is an item with a property whose value is a product
+ ID. The ID is not human-friendly, so the product's name is used
+ the human-visible text instead of the ID.</p>
+
+ <pre><h1 itemscope>
+ <data itemprop="product-id" value="9678AOU879">The Instigator 2000</data>
+</h1></pre>
+
+ </div>
+
+ <p>For date- and time-related data, the <code><a href=#the-time-element>time</a></code> element
+ and its <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute
+ can be used instead.</p>
+
+ <div class=example>
+
<p>In this example, the item has one property, "birthday", whose
value is a date:</p>
<pre><div itemscope>
- I was born on <data itemprop="birthday" value="2009-05-10">May 10th 2009</data>.
+ I was born on <time itemprop="birthday" datetime="2009-05-10">May 10th 2009</time>.
</div></pre>
</div>
@@ -57661,7 +58437,7 @@
<dt>Author
<dd itemprop="author">Peter F. Hamilton
<dt>Publication date
- <dd><data itemprop="pubdate" value="1996-01-26">26 January 1996</data>
+ <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time>
</dl></pre>
<p>The "<code title="">http://vocab.example.net/book</code>"
@@ -58272,6 +59048,12 @@
the empty string otherwise.</dd>
+ <dt>If the element is a <code><a href=#the-time-element>time</a></code> element</dt>
+
+ <dd><p>The value is the element's <a href=#datetime-value>datetime
+ value</a>.</dd>
+
+
<dt>Otherwise</dt>
<dd><p>The value is the element's
@@ -58581,6 +59363,15 @@
<dd><p>The attribute must act as it would if it was <a href=#reflect title=reflect>reflecting</a> the element's <code title=attr-data-value><a href=#attr-data-value>value</a></code> content attribute.</dd>
+ <dt>If the element is a <code><a href=#the-time-element>time</a></code> element</dt>
+
+ <dd><p>On getting, if the element has a <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content attribute, the
+ IDL attribute must return that content attribute's value;
+ otherwise, it must return the element's <code><a href=#textcontent>textContent</a></code>.
+ On setting, the IDL attribute must act as it would if it was <a href=#reflect title=reflect>reflecting</a> the element's <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content
+ attribute.</dd>
+
+
<dt>Otherwise</dt>
<dd><p>The attribute must act the same as the element's
@@ -60972,8 +61763,8 @@
...
<h1 itemprop="summary">Bluesday Tuesday: Money Road</h1>
...
- <data itemprop="dtstart" value="2009-05-05T19:00:00Z">May 5th @ 7pm</data>
- (until <data itemprop="dtend" value="2009-05-05T21:00:00Z">9pm</data>)
+ <time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th @ 7pm</time>
+ (until <time itemprop="dtend" datetime="2009-05-05T21:00:00Z">9pm</time>)
...
<a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
rel="bookmark" itemprop="url">Link to this page</a>
@@ -61034,8 +61825,8 @@
<pre><div itemscope itemtype="http://microformats.org/profile/hcalendar#vevent">
<p>I'm going to
<strong itemprop="summary">Bluesday Tuesday: Money Road</strong>,
- <data itemprop="dtstart" value="2009-05-05T19:00:00Z">May 5th at 7pm</data>
- to <data itemprop="dtend" value="2009-05-05T21:00:00Z">9pm</data>,
+ <time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th at 7pm</time>
+ to <time itemprop="dtend" datetime="2009-05-05T21:00:00Z">9pm</time>,
at <span itemprop="location">The RoadHouse</span>!</p>
<p><a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
itemprop="url">See this event on livebrum.co.uk</a>.</p>
@@ -98187,6 +98978,8 @@
<p><i>This section is non-normative.</i></p>
+ <!-- XXX this index doesn't list the palpable elements -->
+
<table><caption>List of elements</caption>
<thead><tr><th> Element
<th> Description
@@ -99242,6 +100035,15 @@
<td><code><a href=#the-tr-element>tr</a></code></td>
<td><a href=#global-attributes title="global attributes">globals</a></td>
<td><code><a href=#htmltablesectionelement>HTMLTableSectionElement</a></code></td>
+ <tr><th><code><a href=#the-time-element>time</a></code></th>
+ <td>Machine-readable equivalent of date- or time-related data</td>
+ <td><a href=#flow-content title="Flow content">flow</a>;
+ <a href=#phrasing-content title="Phrasing content">phrasing</a></td>
+ <td><a href=#phrasing-content title="Phrasing content">phrasing</a></td>
+ <td><a href=#phrasing-content title="Phrasing content">phrasing</a></td>
+ <td><a href=#global-attributes title="global attributes">globals</a>;
+ <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code></td>
+ <td><code><a href=#htmltimeelement>HTMLTimeElement</a></code></td>
<tr><th><code><a href=#the-title-element>title</a></code></th>
<td>Document title</td>
<td><a href=#metadata-content title="Metadata content">metadata</a></td>
@@ -99439,6 +100241,7 @@
<code><a href=#svg>svg</a></code>;
<code><a href=#the-table-element>table</a></code>;
<code><a href=#the-textarea-element>textarea</a></code>;
+ <code><a href=#the-time-element>time</a></code>;
<code><a href=#the-u-element>u</a></code>;
<code><a href=#the-ul-element>ul</a></code>;
<code><a href=#the-var-element>var</a></code>;
@@ -99519,6 +100322,7 @@
<code><a href=#the-sub-and-sup-elements>sup</a></code>;
<code><a href=#svg>svg</a></code>;
<code><a href=#the-textarea-element>textarea</a></code>;
+ <code><a href=#the-time-element>time</a></code>;
<code><a href=#the-u-element>u</a></code>;
<code><a href=#the-var-element>var</a></code>;
<code><a href=#the-video-element>video</a></code>;
@@ -99707,6 +100511,7 @@
<code><a href=#svg>svg</a></code>;
<code><a href=#the-table-element>table</a></code>;
<code><a href=#the-textarea-element>textarea</a></code>;
+ <code><a href=#the-time-element>time</a></code>;
<code><a href=#the-u-element>u</a></code>;
<code><a href=#the-var-element>var</a></code>;
<code><a href=#the-video-element>video</a></code>
@@ -99849,6 +100654,19 @@
<code title=attr-mod-datetime><a href=#attr-mod-datetime>ins</a></code>
<td> Date and (optionally) time of the change
<td> <a href=#valid-date-string-with-optional-time>Valid date string with optional time</a>
+ <tr><th> <code title="">datetime</code>
+ <td> <code title=attr-time-datetime><a href=#attr-time-datetime>time</a></code>
+ <td> Machine-readable value
+ <td> <a href=#valid-month-string>Valid month string</a>,
+ <a href=#valid-date-string>valid date string</a>,
+ <a href=#valid-yearless-date-string>valid yearless date string</a>,
+ <a href=#valid-time-string>valid time string</a>,
+ <a href=#valid-local-date-and-time-string>valid local date and time string</a>,
+ <a href=#valid-time-zone-offset-string>valid time-zone offset string</a>,
+ <a href=#valid-global-date-and-time-string>valid global date and time string</a>,
+ <a href=#valid-week-string>valid week string</a>,
+ <a href=#valid-non-negative-integer>valid non-negative integer</a>, or
+ <a href=#valid-duration-string>valid duration string</a>
<tr><th> <code title="">default</code>
<td> <code title=attr-track-default><a href=#attr-track-default>track</a></code>
<td> Enable the track if no other <a href=#text-track>text track</a> is more suitable.
@@ -100352,11 +101170,6 @@
"<code title=attr-button-type-reset><a href=#attr-button-type-reset>reset</a></code>";
"<code title=attr-button-type-button><a href=#attr-button-type-button>button</a></code>"
<tr><th> <code title="">type</code>
- <td> <code title=attr-button-type><a href=#attr-button-type>button</a></code>;
- <code title=attr-input-type><a href=#attr-input-type>input</a></code>
- <td> Type of form control
- <td> <a href=#attr-input-type title=attr-input-type><code>input</code> type keyword</a>
- <tr><th> <code title="">type</code>
<td> <code title=attr-command-type><a href=#attr-command-type>command</a></code>
<td> Type of command
<td> "<code title=attr-command-type-keyword-command><a href=#attr-command-type-keyword-command>command</a></code>";
@@ -100371,6 +101184,10 @@
<td> Type of embedded resource
<td> <a href=#valid-mime-type>Valid MIME type</a>
<tr><th> <code title="">type</code>
+ <td> <code title=attr-input-type><a href=#attr-input-type>input</a></code>
+ <td> Type of form control
+ <td> <a href=#attr-input-type title=attr-input-type><code>input</code> type keyword</a>
+ <tr><th> <code title="">type</code>
<td> <code title=attr-menu-type><a href=#attr-menu-type>menu</a></code>
<td> Type of menu
<td> "<code title="context menu state"><a href=#context-menu-state>context</a></code>"; "<code title="toolbar state"><a href=#toolbar-state>toolbar</a></code>"
@@ -100389,7 +101206,7 @@
<td> Value to be used for <a href=#form-submission>form submission</a>
<td> <a href=#attribute-text>Text</a>
<tr><th> <code title="">value</code>
- <td> <code title=attr-data-value><a href=#attr-data-value>input</a></code>
+ <td> <code title=attr-data-value><a href=#attr-data-value>data</a></code>
<td> Machine-readable value
<td> <a href=#attribute-text>Text</a>*
<tr><th> <code title="">value</code>
@@ -101120,6 +101937,9 @@
<tr><td> <code><a href=#the-thead-element>thead</a></code>
<td> <code><a href=#htmltablesectionelement>HTMLTableSectionElement</a></code> : <code><a href=#htmlelement>HTMLElement</a></code>
+ <tr><td> <code><a href=#the-time-element>time</a></code>
+ <td> <code><a href=#htmltimeelement>HTMLTimeElement</a></code> : <code><a href=#htmlelement>HTMLElement</a></code>
+
<tr><td> <code><a href=#the-title-element>title</a></code>
<td> <code><a href=#htmltitleelement>HTMLTitleElement</a></code> : <code><a href=#htmlelement>HTMLElement</a></code>
Modified: images/content-venn.svg
===================================================================
--- images/content-venn.svg 2011-11-12 00:22:15 UTC (rev 6826)
+++ images/content-venn.svg 2011-11-18 19:43:57 UTC (rev 6827)
@@ -38,6 +38,7 @@
<li><code>cite</code></li>
<li><code>code</code></li>
<li><code>command</code></li>
+ <li><code>date</code></li>
<li><code>datalist</code></li>
<li><code>del</code></li>
<li><code>details</code></li>
@@ -209,6 +210,7 @@
<li><code>cite</code></li>
<li><code>code</code></li>
<li><code>command</code></li>
+ <li><code>date</code></li>
<li><code>datalist</code></li>
<li><code>del</code>*</li>
<li><code>dfn</code></li>
Modified: index
===================================================================
--- index 2011-11-12 00:22:15 UTC (rev 6826)
+++ index 2011-11-18 19:43:57 UTC (rev 6827)
@@ -240,7 +240,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
- <h2 class="no-num no-toc">Living Standard — Last Updated 11 November 2011</h2>
+ <h2 class="no-num no-toc">Living Standard — Last Updated 18 November 2011</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
@@ -334,11 +334,14 @@
<ol>
<li><a href=#months><span class=secno>2.5.5.1 </span>Months</a></li>
<li><a href=#dates><span class=secno>2.5.5.2 </span>Dates</a></li>
- <li><a href=#times><span class=secno>2.5.5.3 </span>Times</a></li>
- <li><a href=#local-dates-and-times><span class=secno>2.5.5.4 </span>Local dates and times</a></li>
- <li><a href=#global-dates-and-times><span class=secno>2.5.5.5 </span>Global dates and times</a></li>
- <li><a href=#weeks><span class=secno>2.5.5.6 </span>Weeks</a></li>
- <li><a href=#vaguer-moments-in-time><span class=secno>2.5.5.7 </span>Vaguer moments in time</a></ol></li>
+ <li><a href=#yearless-dates><span class=secno>2.5.5.3 </span>Yearless dates</a></li>
+ <li><a href=#times><span class=secno>2.5.5.4 </span>Times</a></li>
+ <li><a href=#local-dates-and-times><span class=secno>2.5.5.5 </span>Local dates and times</a></li>
+ <li><a href=#time-zones><span class=secno>2.5.5.6 </span>Time zones</a></li>
+ <li><a href=#global-dates-and-times><span class=secno>2.5.5.7 </span>Global dates and times</a></li>
+ <li><a href=#weeks><span class=secno>2.5.5.8 </span>Weeks</a></li>
+ <li><a href=#durations><span class=secno>2.5.5.9 </span>Durations</a></li>
+ <li><a href=#vaguer-moments-in-time><span class=secno>2.5.5.10 </span>Vaguer moments in time</a></ol></li>
<li><a href=#colors><span class=secno>2.5.6 </span>Colors</a></li>
<li><a href=#space-separated-tokens><span class=secno>2.5.7 </span>Space-separated tokens</a></li>
<li><a href=#comma-separated-tokens><span class=secno>2.5.8 </span>Comma-separated tokens</a></li>
@@ -498,24 +501,25 @@
<li><a href=#the-dfn-element><span class=secno>4.6.8 </span>The <code>dfn</code> element</a></li>
<li><a href=#the-abbr-element><span class=secno>4.6.9 </span>The <code>abbr</code> element</a></li>
<li><a href=#the-data-element><span class=secno>4.6.10 </span>The <code>data</code> element</a></li>
- <li><a href=#the-code-element><span class=secno>4.6.11 </span>The <code>code</code> element</a></li>
- <li><a href=#the-var-element><span class=secno>4.6.12 </span>The <code>var</code> element</a></li>
- <li><a href=#the-samp-element><span class=secno>4.6.13 </span>The <code>samp</code> element</a></li>
- <li><a href=#the-kbd-element><span class=secno>4.6.14 </span>The <code>kbd</code> element</a></li>
- <li><a href=#the-sub-and-sup-elements><span class=secno>4.6.15 </span>The <code>sub</code> and <code>sup</code> elements</a></li>
- <li><a href=#the-i-element><span class=secno>4.6.16 </span>The <code>i</code> element</a></li>
- <li><a href=#the-b-element><span class=secno>4.6.17 </span>The <code>b</code> element</a></li>
- <li><a href=#the-u-element><span class=secno>4.6.18 </span>The <code>u</code> element</a></li>
- <li><a href=#the-mark-element><span class=secno>4.6.19 </span>The <code>mark</code> element</a></li>
- <li><a href=#the-ruby-element><span class=secno>4.6.20 </span>The <code>ruby</code> element</a></li>
- <li><a href=#the-rt-element><span class=secno>4.6.21 </span>The <code>rt</code> element</a></li>
- <li><a href=#the-rp-element><span class=secno>4.6.22 </span>The <code>rp</code> element</a></li>
- <li><a href=#the-bdi-element><span class=secno>4.6.23 </span>The <code>bdi</code> element</a></li>
- <li><a href=#the-bdo-element><span class=secno>4.6.24 </span>The <code>bdo</code> element</a></li>
- <li><a href=#the-span-element><span class=secno>4.6.25 </span>The <code>span</code> element</a></li>
- <li><a href=#the-br-element><span class=secno>4.6.26 </span>The <code>br</code> element</a></li>
- <li><a href=#the-wbr-element><span class=secno>4.6.27 </span>The <code>wbr</code> element</a></li>
- <li><a href=#usage-summary><span class=secno>4.6.28 </span>Usage summary</a></ol></li>
+ <li><a href=#the-time-element><span class=secno>4.6.11 </span>The <code>time</code> element</a></li>
+ <li><a href=#the-code-element><span class=secno>4.6.12 </span>The <code>code</code> element</a></li>
+ <li><a href=#the-var-element><span class=secno>4.6.13 </span>The <code>var</code> element</a></li>
+ <li><a href=#the-samp-element><span class=secno>4.6.14 </span>The <code>samp</code> element</a></li>
+ <li><a href=#the-kbd-element><span class=secno>4.6.15 </span>The <code>kbd</code> element</a></li>
+ <li><a href=#the-sub-and-sup-elements><span class=secno>4.6.16 </span>The <code>sub</code> and <code>sup</code> elements</a></li>
+ <li><a href=#the-i-element><span class=secno>4.6.17 </span>The <code>i</code> element</a></li>
+ <li><a href=#the-b-element><span class=secno>4.6.18 </span>The <code>b</code> element</a></li>
+ <li><a href=#the-u-element><span class=secno>4.6.19 </span>The <code>u</code> element</a></li>
+ <li><a href=#the-mark-element><span class=secno>4.6.20 </span>The <code>mark</code> element</a></li>
+ <li><a href=#the-ruby-element><span class=secno>4.6.21 </span>The <code>ruby</code> element</a></li>
+ <li><a href=#the-rt-element><span class=secno>4.6.22 </span>The <code>rt</code> element</a></li>
+ <li><a href=#the-rp-element><span class=secno>4.6.23 </span>The <code>rp</code> element</a></li>
+ <li><a href=#the-bdi-element><span class=secno>4.6.24 </span>The <code>bdi</code> element</a></li>
+ <li><a href=#the-bdo-element><span class=secno>4.6.25 </span>The <code>bdo</code> element</a></li>
+ <li><a href=#the-span-element><span class=secno>4.6.26 </span>The <code>span</code> element</a></li>
+ <li><a href=#the-br-element><span class=secno>4.6.27 </span>The <code>br</code> element</a></li>
+ <li><a href=#the-wbr-element><span class=secno>4.6.28 </span>The <code>wbr</code> element</a></li>
+ <li><a href=#usage-summary><span class=secno>4.6.29 </span>Usage summary</a></ol></li>
<li><a href=#edits><span class=secno>4.7 </span>Edits</a>
<ol>
<li><a href=#the-ins-element><span class=secno>4.7.1 </span>The <code>ins</code> element</a></li>
@@ -5626,8 +5630,99 @@
</ol></div>
- <h5 id=times><span class=secno>2.5.5.3 </span>Times</h5>
+ <h5 id=yearless-dates><span class=secno>2.5.5.3 </span>Yearless dates</h5>
+ <p>A <dfn id=concept-yearless-date title=concept-yearless-date>yearless date</dfn> consists
+ of a month and a day, but with no associated year.</p>
+
+ <p>A string is a <dfn id=valid-yearless-date-string>valid yearless date string</dfn> representing
+ a month <var title="">month</var> and a day <var title="">day</var>
+ if it consists of the following components in the given order:</p>
+
+ <ol><li>Optionally, two U+002D HYPHEN-MINUS characters (-)</li>
+
+ <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
+ representing the month <var title="">month</var>, in the range
+ 1 ≤ <var title="">month</var> ≤ 12</li>
+
+ <li>A U+002D HYPHEN-MINUS character (-)</li>
+
+ <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
+ representing <var title="">day</var>, in the range
+ 1 ≤ <var title="">day</var> ≤ <var title="">maxday</var> where <var title="">maxday</var> is the <a href=#number-of-days-in-month-month-of-year-year title="number of days in month month of year year">number of
+ days</a> in the month <var title="">month</var> and any
+ arbitrary leap year (e.g. 4 or 2000)</li>
+
+ </ol><p class=note>In other words, if the <var title="">month</var> is
+ "<code title="">02</code>", meaning February, then the day can be
+ 29, as if the year was a leap year.</p>
+
+ <div class=impl>
+
+ <p>The rules to <dfn id=parse-a-yearless-date-string>parse a yearless date string</dfn> are as
+ follows. This will return either a month and a day, or nothing. If
+ at any point the algorithm says that it "fails", this means that it
+ is aborted at that point and returns nothing.</p>
+
+ <ol><li><p>Let <var title="">input</var> be the string being
+ parsed.</li>
+
+ <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
+ string.</li>
+
+ <li><p><a href=#parse-a-yearless-date-component>Parse a yearless date component</a> to obtain <var title="">month</var> and <var title="">day</var>. If this returns
+ nothing, then fail.</p>
+
+ <li><p>If <var title="">position</var> is <em>not</em> beyond the
+ end of <var title="">input</var>, then fail.</li>
+
+ <li><p>Return <var title="">month</var> and <var title="">day</var>.</li>
+
+ </ol><p>The rules to <dfn id=parse-a-yearless-date-component>parse a yearless date component</dfn>, given an
+ <var title="">input</var> string and a <var title="">position</var>,
+ are as follows. This will return either a month and a day, or
+ nothing. If at any point the algorithm says that it "fails", this
+ means that it is aborted at that point and returns nothing.</p>
+
+ <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+ U+002D HYPHEN-MINUS characters (-). If the collected sequence is
+ not exactly zero or two characters long, then fail.</li>
+
+ <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then fail. Otherwise,
+ interpret the resulting sequence as a base-ten integer. Let that
+ number be the <var title="">month</var>.</li>
+
+ <li><p>If <var title="">month</var> is not a number in the range
+ 1 ≤ <var title="">month</var> ≤ 12, then
+ fail.</li>
+
+ <li><p>Let <var title="">maxday</var> be the <a href=#number-of-days-in-month-month-of-year-year title="number of
+ days in month month of year year">number of days</a> in month
+ <var title="">month</var> of any arbitrary leap year (e.g. 4 or
+ 2000).</li>
+
+ <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> or if the character at <var title="">position</var> is not a U+002D HYPHEN-MINUS character,
+ then fail. Otherwise, move <var title="">position</var> forwards
+ one character.</li>
+
+ <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then fail. Otherwise,
+ interpret the resulting sequence as a base-ten integer. Let that
+ number be the <var title="">day</var>.</li>
+
+ <li><p>If <var title="">day</var> is not a number in the range
+ 1 ≤ <var title="">day</var> ≤ <var title="">maxday</var>, then fail.</li>
+
+ <li><p>Return <var title="">month</var> and <var title="">day</var>.</li>
+
+ </ol></div>
+
+
+ <h5 id=times><span class=secno>2.5.5.4 </span>Times</h5>
+
<p>A <dfn id=concept-time title=concept-time>time</dfn> consists of a specific
time with no time-zone information, consisting of an hour, a minute,
a second, and a fraction of a second.</p>
@@ -5764,7 +5859,7 @@
</ol></div>
- <h5 id=local-dates-and-times><span class=secno>2.5.5.4 </span>Local dates and times</h5>
+ <h5 id=local-dates-and-times><span class=secno>2.5.5.5 </span>Local dates and times</h5>
<p>A <dfn id=concept-datetime-local title=concept-datetime-local>local date and time</dfn>
consists of a specific proleptic Gregorian date, consisting of a
@@ -5815,9 +5910,140 @@
</ol></div>
+ <h5 id=time-zones><span class=secno>2.5.5.6 </span>Time zones</h5>
- <h5 id=global-dates-and-times><span class=secno>2.5.5.5 </span>Global dates and times</h5>
+ <p>A <dfn id=concept-timezone title=concept-timezone>time-zone offset</dfn> consists
+ of a signed number of hours and minutes.</p>
+ <p>A string is a <dfn id=valid-time-zone-offset-string>valid time-zone offset string</dfn>
+ representing a time-zone offset if it consists of either:</p>
+
+
+ <ul><li><p>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only
+ if the time zone is UTC</li>
+
+ <li>
+
+ <p>Or, the following components, in the given order:</p>
+
+ <ol><li>Either a U+002B PLUS SIGN character (+) or, if the
+ time-zone offset is not zero, a U+002D HYPHEN-MINUS character
+ (-), representing the sign of the time-zone offset</li>
+ <!-- the -00:00 offset is disallowed because RFC3339 gives it a
+ special semantic -->
+
+ <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
+ representing the hours component <var title="">hour</var> of
+ the time-zone offset, in the range 0 ≤ <var title="">hour</var> ≤ 23</li>
+
+ <li>A U+003A COLON character (:)</li>
+
+ <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
+ representing the minutes component <var title="">minute</var>
+ of the time-zone offset, in the range 0 ≤ <var title="">minute</var> ≤ 59</li>
+
+ </ol></li>
+
+ </ul><p class=note>This format allows for time-zone offsets from -23:59
+ to +23:59. In practice, however, the range of offsets of actual time
+ zones is -12:00 to +14:00, and the minutes component of offsets of
+ actual time zones is always either 00, 30, or 45.</p>
+
+ <p class=note>See also the usage notes and examples in the <a href=#concept-datetime title=concept-datetime>global date and time</a> section below
+ for details on using time-zone offsets with historical times that
+ predate the formation of formal time zones.</p>
+
+ <div class=impl>
+
+ <p>The rules to <dfn id=parse-a-time-zone-offset-string>parse a time-zone offset string</dfn> are as
+ follows. This will return either a time-zone offset, or nothing. If
+ at any point the algorithm says that it "fails", this means that it
+ is aborted at that point and returns nothing.</p>
+
+ <ol><li><p>Let <var title="">input</var> be the string being
+ parsed.</li>
+
+ <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
+ string.</li>
+
+ <li><p><a href=#parse-a-time-zone-offset-component>Parse a time-zone offset component</a> to obtain
+ <var title="">timezone<sub title="">hours</sub></var> and <var title="">timezone<sub title="">minutes</sub></var>. If this returns
+ nothing, then fail.</p>
+
+ <li><p>If <var title="">position</var> is <em>not</em> beyond the
+ end of <var title="">input</var>, then fail.</li>
+
+ <li><p>Return the time-zone offset that is <var title="">timezone<sub title="">hours</sub></var> hours and <var title="">timezone<sub title="">minutes</sub></var> minutes from
+ UTC.</li>
+
+ </ol><p>The rules to <dfn id=parse-a-time-zone-offset-component>parse a time-zone offset component</dfn>, given
+ an <var title="">input</var> string and a <var title="">position</var>, are as follows. This will return either
+ time-zone hours and time-zone minutes, or nothing. If at any point
+ the algorithm says that it "fails", this means that it is aborted at
+ that point and returns nothing.</p>
+
+ <ol><li>
+
+ <p>If the character at <var title="">position</var> is a U+005A
+ LATIN CAPITAL LETTER Z character (Z), then:</p>
+
+ <ol><li><p>Let <var title="">timezone<sub title="">hours</sub></var>
+ be 0.</li>
+
+ <li><p>Let <var title="">timezone<sub title="">minutes</sub></var> be 0.</li>
+
+ <li><p>Advance <var title="">position</var> to the next character
+ in <var title="">input</var>.</li>
+
+ </ol><p>Otherwise, if the character at <var title="">position</var> is
+ either a U+002B PLUS SIGN (+) or a U+002D HYPHEN-MINUS (-),
+ then:</p>
+
+ <ol><li><p>If the character at <var title="">position</var> is a
+ U+002B PLUS SIGN (+), let <var title="">sign</var> be
+ "positive". Otherwise, it's a U+002D HYPHEN-MINUS (-); let <var title="">sign</var> be "negative".</li>
+
+ <li><p>Advance <var title="">position</var> to the next character
+ in <var title="">input</var>.</li>
+
+ <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then
+ fail. Otherwise, interpret the resulting sequence as a base-ten
+ integer. Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</li>
+
+ <li>If <var title="">timezone<sub title="">hours</sub></var> is
+ not a number in the range 0 ≤ <var title="">timezone<sub title="">hours</sub></var> ≤ 23, then fail.</li>
+
+ <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">hours</sub></var>.</li>
+
+ <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then
+ fail. Otherwise, move <var title="">position</var> forwards one
+ character.</li>
+
+ <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then
+ fail. Otherwise, interpret the resulting sequence as a base-ten
+ integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</li>
+
+ <li>If <var title="">timezone<sub title="">minutes</sub></var> is
+ not a number in the range 0 ≤ <var title="">timezone<sub title="">minutes</sub></var> ≤ 59, then fail.</li>
+
+ <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">minutes</sub></var>.</li>
+
+ </ol><p>Otherwise, fail.</p>
+
+ </li>
+
+ <li><p>Return <var title="">timezone<sub title="">hours</sub></var>
+ and <var title="">timezone<sub title="">minutes</sub></var>.</li>
+
+ </ol></div>
+
+
+ <h5 id=global-dates-and-times><span class=secno>2.5.5.7 </span>Global dates and times</h5>
+
<p>A <dfn id=concept-datetime title=concept-datetime>global date and time</dfn>
consists of a specific proleptic Gregorian date, consisting of a
year, a month, and a day, and a time, consisting of an hour, a
@@ -5835,39 +6061,9 @@
<li>A <a href=#valid-time-string>valid time string</a> representing the time</li>
- <li>Either:
+ <li>A <a href=#valid-time-zone-offset-string>valid time-zone offset string</a> representing the time-zone offset</li>
- <ul><li>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only
- if the time zone is UTC</li>
-
- <li>Or:
-
- <ol><li>Either a U+002B PLUS SIGN character (+) or, if the
- time-zone offset is not zero, a U+002D HYPHEN-MINUS character
- (-), representing the sign of the time-zone offset</li>
- <!-- the -00:00 offset is disallowed because RFC3339 gives it a
- special semantic -->
-
- <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
- representing the hours component <var title="">hour</var> of
- the time-zone offset, in the range 0 ≤ <var title="">hour</var> ≤ 23</li>
-
- <li>A U+003A COLON character (:)</li>
-
- <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
- representing the minutes component <var title="">minute</var>
- of the time-zone offset, in the range 0 ≤ <var title="">minute</var> ≤ 59</li>
-
- </ol></li>
-
- </ul></li>
-
- </ol><p class=note>This format allows for time-zone offsets from -23:59
- to +23:59. In practice, however, the range of offsets of actual time
- zones is -12:00 to +14:00, and the minutes component of offsets of
- actual time zones is always either 00, 30, or 45.</p>
-
- <p>Times in dates before the formation of UTC in the mid twentieth
+ </ol><p>Times in dates before the formation of UTC in the mid twentieth
century must be expressed and interpreted in terms of UT1
(contemporary Earth solar time at the 0° longitude), not UTC
(the approximation of UT1 that ticks in SI seconds). Time before the
@@ -5994,73 +6190,10 @@
<li><p>Return <var title="">time</var> and <var title="">timezone</var>.</li>
- </ol><p>The rules to <dfn id=parse-a-time-zone-offset-component>parse a time-zone offset component</dfn>, given
- an <var title="">input</var> string and a <var title="">position</var>, are as follows. This will return either
- time-zone hours and time-zone minutes, or nothing. If at any point
- the algorithm says that it "fails", this means that it is aborted at
- that point and returns nothing.</p>
-
- <ol><li>
-
- <p>If the character at <var title="">position</var> is a U+005A
- LATIN CAPITAL LETTER Z character (Z), then:</p>
-
- <ol><li><p>Let <var title="">timezone<sub title="">hours</sub></var>
- be 0.</li>
-
- <li><p>Let <var title="">timezone<sub title="">minutes</sub></var> be 0.</li>
-
- <li><p>Advance <var title="">position</var> to the next character
- in <var title="">input</var>.</li>
-
- </ol><p>Otherwise, if the character at <var title="">position</var> is
- either a U+002B PLUS SIGN (+) or a U+002D HYPHEN-MINUS (-),
- then:</p>
-
- <ol><li><p>If the character at <var title="">position</var> is a
- U+002B PLUS SIGN (+), let <var title="">sign</var> be
- "positive". Otherwise, it's a U+002D HYPHEN-MINUS (-); let <var title="">sign</var> be "negative".</li>
-
- <li><p>Advance <var title="">position</var> to the next character
- in <var title="">input</var>.</li>
-
- <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
- U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
- sequence is not exactly two characters long, then
- fail. Otherwise, interpret the resulting sequence as a base-ten
- integer. Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</li>
-
- <li>If <var title="">timezone<sub title="">hours</sub></var> is
- not a number in the range 0 ≤ <var title="">timezone<sub title="">hours</sub></var> ≤ 23, then fail.</li>
-
- <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">hours</sub></var>.</li>
-
- <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then
- fail. Otherwise, move <var title="">position</var> forwards one
- character.</li>
-
- <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
- U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
- sequence is not exactly two characters long, then
- fail. Otherwise, interpret the resulting sequence as a base-ten
- integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</li>
-
- <li>If <var title="">timezone<sub title="">minutes</sub></var> is
- not a number in the range 0 ≤ <var title="">timezone<sub title="">minutes</sub></var> ≤ 59, then fail.</li>
-
- <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">minutes</sub></var>.</li>
-
- </ol><p>Otherwise, fail.</p>
-
- </li>
-
- <li><p>Return <var title="">timezone<sub title="">hours</sub></var>
- and <var title="">timezone<sub title="">minutes</sub></var>.</li>
-
</ol></div>
- <h5 id=weeks><span class=secno>2.5.5.6 </span>Weeks</h5>
+ <h5 id=weeks><span class=secno>2.5.5.8 </span>Weeks</h5>
<p>A <dfn id=concept-week title=concept-week>week</dfn> consists of a week-year
number and a week number representing a seven-day period starting on
@@ -6155,41 +6288,413 @@
</ol></div>
- <h5 id=vaguer-moments-in-time><span class=secno>2.5.5.7 </span>Vaguer moments in time</h5>
+ <h5 id=durations><span class=secno>2.5.5.9 </span>Durations</h5>
- <p>A string is a <dfn id=valid-date-or-time-string>valid date or time string</dfn> if it is also
- one of the following:</p>
+ <p>A <dfn id=concept-duration title=concept-duration>duration</dfn> consists of
+ <!--MONTHS: either a number of months or--> a number of seconds.</p>
- <ul><li>A <a href=#valid-date-string>valid date string</a>.</li>
+ <p class=note>Since months and seconds are not comparable (a month
+ is not a precise number of seconds, but is instead a period whose
+ exact length depends on the precise day from which it is measured) a
+ <a href=#concept-duration title=concept-duration>duration</a> as defined in this
+ specification cannot <!--MONTHS: consist of a mixture of both-->
+ include months (or years, which are equivalent to twelve months).
+ Only durations that describe a specific number of seconds can be
+ described.</p>
- <li>A <a href=#valid-time-string>valid time string</a>.</li>
+ <p>A string is a <dfn id=valid-duration-string>valid duration string</dfn> representing a
+ <a href=#concept-duration title=concept-duration>duration</a> <var title="">t</var>
+ if it consists of either of the following:</p>
- <li>A <a href=#valid-global-date-and-time-string>valid global date and time string</a>.</li>
+ <ul><li>
- </ul><p>A string is a <dfn id=valid-date-or-time-string-in-content>valid date or time string in content</dfn> if
- it consists of zero or more <a href=#white_space>White_Space</a> characters,
- followed by a <a href=#valid-date-or-time-string>valid date or time string</a>, followed by
- zero or more further <a href=#white_space>White_Space</a> characters.</p>
+ <!-- The ISO format -->
- <hr><p>A string is a <dfn id=valid-date-string-with-optional-time>valid date string with optional time</dfn> if
+ <!-- NOTE: ISO durations also have a number of formats we do not
+ consider conforming:
+
+ - a "week" format (e.g. P4W). This one is actually supported
+ by the parser.
+
+ - P<date>T<time>, with or without hyphens
+
+ - All these formats, with commas instead of periods for the
+ seconds decimal
+
+ -->
+
+ <p>A literal U+0050 LATIN CAPITAL LETTER P character followed by
+ one or more of the following subcomponents, in the order given,
+ where <!--the number of years, if any, multiplied by twelve, plus
+ the number of months, if any, equals the number of months in <var
+ title="">t</var>, if the duration is in months; or, if it is in
+ seconds, -->the number of days, hours, minutes, and seconds
+ corresponds to the same number of seconds as in <var title="">t</var>:</p>
+
+ <ol><!--MONTHS:
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a U+0059
+ LATIN CAPITAL LETTER Y character, representing a number of
+ years.</p></li>
+
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a U+004D
+ LATIN CAPITAL LETTER M character, representing a number of
+ months.</p></li>
+--><li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> followed by a U+0044
+ LATIN CAPITAL LETTER D character, representing a number of
+ days.</li>
+
+ <li>
+
+ <p>A U+0054 LATIN CAPITAL LETTER T character followed by one or
+ more of the following subcomponents, in the order given:</p>
+
+ <ol><li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> followed by a
+ U+0048 LATIN CAPITAL LETTER H character, representing a number
+ of hours.</li>
+
+ <li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> followed by a
+ U+004D LATIN CAPITAL LETTER M character, representing a number
+ of minutes.</li>
+
+ <li>
+
+ <p>The following components:</p>
+
+ <ol><li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing a
+ number of seconds.</li>
+
+ <li><p>Optionally, a U+002E FULL STOP character (.) followed
+ by one or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing a
+ fraction of a second.</li>
+
+ <li><p>A U+0053 LATIN CAPITAL LETTER S character.</li>
+
+ </ol></li>
+
+ </ol></li>
+
+ </ol><p class=note>This, as with a number of other date- and
+ time-related microsyntaxes defined in this specification, is based
+ on one of the formats defined in ISO 8601. <a href=#refsISO8601>[ISO8601]</a></p>
+
+ </li>
+
+ <li>
+
+ <p>One or more <a href=#duration-time-component title="duration time component">duration time
+ components</a>, each with a different <a href=#duration-time-component-scale>duration time
+ component scale</a>, in any order; the sum of the represented
+ seconds being equal to the number of seconds in <var title="">t</var>.</p>
+
+ <p>A <dfn id=duration-time-component>duration time component</dfn> is a string consisting of
+ the following components:</p>
+
+ <ol><li><p>Zero or more <a href=#space-character title="space character">space
+ characters</a>.</li>
+
+ <li><p>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing a
+ number of time units, scaled by the <a href=#duration-time-component-scale>duration time component
+ scale</a> specified (see below) to represent a number of
+ seconds.</li>
+
+ <li><p>If the <a href=#duration-time-component-scale>duration time component scale</a>
+ specified is 1 (i.e. the units are seconds), then, optionally, a
+ U+002E FULL STOP character (.) followed by one or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing a
+ fraction of a second.</li>
+
+ <li><p>Zero or more <a href=#space-character title="space character">space
+ characters</a>.</li>
+
+ <li>
+
+ <p>One of the following characters, representing the
+ <dfn id=duration-time-component-scale>duration time component scale</dfn> of the time unit used
+ in the numeric part of the <a href=#duration-time-component>duration time
+ component</a>:</p>
+
+ <dl><dt>U+0057 LATIN CAPITAL LETTER W character</dt>
+ <dt>U+0077 LATIN SMALL LETTER W character</dt>
+
+ <dd>Weeks. The scale is 604800.</dd>
+
+ <dt>U+0044 LATIN CAPITAL LETTER D character</dt>
+ <dt>U+0064 LATIN SMALL LETTER D character</dt>
+
+ <dd>Days. The scale is 86400.</dd>
+
+ <dt>U+0048 LATIN CAPITAL LETTER H character</dt>
+ <dt>U+0068 LATIN SMALL LETTER H character</dt>
+
+ <dd>Hours. The scale is 3600.</dd>
+
+ <dt>U+004D LATIN CAPITAL LETTER M character</dt>
+ <dt>U+006D LATIN SMALL LETTER M character</dt>
+
+ <dd>Minutes. The scale is 60.</dd>
+
+ <dt>U+0053 LATIN CAPITAL LETTER S character</dt>
+ <dt>U+0073 LATIN SMALL LETTER S character</dt>
+
+ <dd>Seconds. The scale is 1.</dd>
+
+ </dl></li>
+
+ <li><p>Zero or more <a href=#space-character title="space character">space
+ characters</a>.</li>
+
+ </ol><p class=note>This is not based on any of the formats in ISO
+ 8601. It is intended to be a more human-readable alternative to
+ the ISO 8601 duration format.</p>
+
+ </li>
+
+ </ul><div class=impl>
+
+ <p>The rules to <dfn id=parse-a-duration-string>parse a duration string</dfn> are as follows.
+ This will return either a <a href=#concept-duration title=concept-duration>duration</a> or nothing. If at any point
+ the algorithm says that it "fails", this means that it is aborted at
+ that point and returns nothing.</p>
+
+ <ol><!--MONTHS: this algorithm actually already parses months
+ adequately, though it would need tweaking if we introduced a "mo"
+ unit for the non-ISO variant. See other "MONTHS" annotations below. --><li><p>Let <var title="">input</var> be the string being
+ parsed.</li>
+
+ <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
+ string.</li>
+
+ <li><p>Let <var title="">months</var>, <var title="">seconds</var>,
+ and <var title="">component count</var> all be zero.</li>
+
+ <li>
+
+ <p>Let <var title="">M-disambiguator</var> be <i>minutes</i>.</p>
+
+ <!--MONTHS: this note would change-->
+ <p class=note>This flag's othe value is <i>months</i>. It is
+ used to disambiguate the "M" unit in ISO8601 durations, which use
+ the same unit for months and minutes. Months are not allowed, but
+ are parsed for future compatibility and to avoid misinterpreting
+ ISO8601 durations that would be valid in other contexts.</p>
+
+ </li>
+
+ <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then fail.</li>
+
+ <li><p>If the character in <var title="">input</var> pointed to by
+ <var title="">position</var> is a U+0050 LATIN CAPITAL LETTER P
+ character, then advance <var title="">position</var> to the next
+ character, set <var title="">M-disambiguator</var> to
+ <i>months</i>, and <a href=#skip-whitespace>skip whitespace</a>.</li>
+
+ <li>
+
+ <p>Run the following substeps in a loop, until the first step in
+ the loop requires that the loop be broken, or until a step
+ requiring the algorithm to fail is reached:</p>
+
+ <ol><li><p>Let <var title="">units</var> be undefined. It will be
+ assigned one of the following values: <i>years</i>,
+ <i>months</i>, <i>weeks</i>, <i>days</i>, <i>hours</i>,
+ <i>minutes</i>, and <i>seconds</i>.</li>
+
+ <li><p>Let <var title="">next character</var> be undefined. It is
+ used to process characters from the <var title="">input</var>.</li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then break the loop.</li>
+
+ <li><p>If the character in <var title="">input</var> pointed to
+ by <var title="">position</var> is a U+0054 LATIN CAPITAL LETTER
+ T character, then advance <var title="">position</var> to the
+ next character, set <var title="">M-disambiguator</var> to
+ <i>minutes</i>, <a href=#skip-whitespace>skip whitespace</a>, and return to the
+ top of the loop.</li>
+
+ <li><p>Set <var title="">next character</var> to the character in
+ <var title="">input</var> pointed to by <var title="">position</var>.</li>
+
+ <li>
+
+ <p>If <var title="">next character</var> is a U+002E FULL STOP
+ character (.), then let <var title="">N</var> equal zero. (Do
+ not advance <var title="">position</var>. That is taken care of
+ below.)</p>
+
+ <p>Otherwise, if <var title="">next character</var> is a
+ character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
+ NINE (9), then <a href=#collect-a-sequence-of-characters>collect a sequence of characters</a> in
+ the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
+ interpret the resulting sequence as a base-ten integer, and let
+ <var title="">N</var> be that number.</p>
+
+ <p>Otherwise <var title="">next character</var> is not part of a
+ number; fail.</p>
+
+ </li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then fail.</li>
+
+ <li><p>Set <var title="">next character</var> to the character in
+ <var title="">input</var> pointed to by <var title="">position</var>, and this time advance <var title="">position</var> to the next character. (If <var title="">next character</var> was a U+002E FULL STOP character
+ (.) before, it will still be that character this time.)</li>
+
+ <li>
+
+ <p>If <var title="">next character</var> is a U+002E FULL STOP
+ character (.), then run these substeps:</p>
+
+ <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the
+ range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). Let <var title="">s</var> be the resulting sequence.</li>
+
+ <li><p>If <var title="">s</var> is the empty string, then
+ fail.</li>
+
+ <li><p>Let <var title="">length</var> be the number of
+ characters in <var title="">s</var>.</li>
+
+ <li><p>Let <var title="">fraction</var> be the result of
+ interpreting <var title="">s</var> as a base-ten integer, and
+ then dividing that number by <span title="">10<sup title=""><var title="">length</var></sup></span>.</li>
+
+ <li><p>Increment <var title="">N</var> by <var title="">fraction</var>.</li>
+
+ <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then fail.</li>
+
+ <li><p>Set <var title="">next character</var> to the character
+ in <var title="">input</var> pointed to by <var title="">position</var>, and advance <var title="">position</var> to the next character.</li>
+
+ <li><p>If <var title="">next character</var> is neither a
+ U+0053 LATIN CAPITAL LETTER S character nor a U+0073 LATIN
+ SMALL LETTER S character, then fail.</li>
+
+ <li><p>Set <var title="">units</var> to <i>seconds</i>.</li>
+
+ </ol><p>Otherwise, run these substeps:</p>
+
+ <ol><li><p>If <var title="">next character</var> is a <a href=#space-character>space
+ character</a>, then <a href=#skip-whitespace>skip whitespace</a>, set <var title="">next character</var> to the character in <var title="">input</var> pointed to by <var title="">position</var>, and advance <var title="">position</var> to the next character.</li>
+
+ <li>
+
+ <!--MONTHS: this would probably be where we would add more
+ logic to support a new unit like 'mo' -->
+
+ <p>If <var title="">next character</var> is a U+0059 LATIN
+ CAPITAL LETTER Y character, or a U+0079 LATIN SMALL LETTER Y
+ character, set <var title="">units</var> to <i>years</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>months</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+004D LATIN
+ CAPITAL LETTER M character or a U+006D LATIN SMALL LETTER M
+ character, and <var title="">M-disambiguator</var> is
+ <i>months</i>, then set <var title="">units</var> to
+ <i>months</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0057 LATIN
+ CAPITAL LETTER W character or a U+0077 LATIN SMALL LETTER W
+ character, set <var title="">units</var> to <i>weeks</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0044 LATIN
+ CAPITAL LETTER D character or a U+0064 LATIN SMALL LETTER D
+ character, set <var title="">units</var> to <i>days</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0048 LATIN
+ CAPITAL LETTER H character or a U+0068 LATIN SMALL LETTER H
+ character, set <var title="">units</var> to <i>hours</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+004D LATIN
+ CAPITAL LETTER M character or a U+006D LATIN SMALL LETTER M
+ character, and <var title="">M-disambiguator</var> is
+ <i>minutes</i>, then set <var title="">units</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0053 LATIN
+ CAPITAL LETTER S character or a U+0073 LATIN SMALL LETTER S
+ character, set <var title="">units</var> to <i>seconds</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>Otherwise if <var title="">next character</var> is none of
+ the above characters, then fail.</p>
+
+ </li>
+
+ </ol></li>
+
+ <li><p>Increment <var title="">component count</var>.</li>
+
+ <li><p>Let <var title="">multiplier</var> be 1.</li>
+
+ <li><p>If <var title="">units</var> is <i>years</i>, multiply
+ <var title="">multiplier</var> by 12 and set <var title="">units</var> to <i>months</i>.</li>
+
+ <li>
+
+ <p>If <var title="">units</var> is <i>months</i>, add the
+ product of <var title="">N</var> and <var title="">multiplier</var> to <var title="">months</var>.</p>
+
+ <p>Otherwise, run these substeps:</p>
+
+ <ol><li><p>If <var title="">units</var> is <i>weeks</i>, multiply
+ <var title="">multiplier</var> by 7 and set <var title="">units</var> to <i>days</i>.</li>
+
+ <li><p>If <var title="">units</var> is <i>days</i>, multiply
+ <var title="">multiplier</var> by 24 and set <var title="">units</var> to <i>hours</i>.</li>
+
+ <li><p>If <var title="">units</var> is <i>hours</i>, multiply
+ <var title="">multiplier</var> by 60 and set <var title="">units</var> to <i>minutes</i>.</li>
+
+ <li><p>If <var title="">units</var> is <i>minutes</i>, multiply
+ <var title="">multiplier</var> by 60 and set <var title="">units</var> to <i>seconds</i>.</li>
+
+ <li><p>Forcibly, <var title="">units</var> is now
+ <i>seconds</i>. Add the product of <var title="">N</var> and
+ <var title="">multiplier</var> to <var title="">seconds</var>.</li>
+
+ </ol></li>
+
+ <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
+
+ </ol></li>
+
+ <li><p>If <var title="">component count</var> is zero,
+ fail.</li>
+
+ <!--MONTHS: if we add month support this is where you'd return them-->
+ <li><p>If <var title="">months</var> is not zero, fail.</li>
+
+ <li><p>Return the <a href=#concept-duration title=concept-duration>duration</a>
+ consisting of <var title="">seconds</var> seconds.</li>
+
+ </ol></div>
+
+
+ <h5 id=vaguer-moments-in-time><span class=secno>2.5.5.10 </span>Vaguer moments in time</h5>
+
+ <p>A string is a <dfn id=valid-date-string-with-optional-time>valid date string with optional time</dfn> if
it is also one of the following:</p>
<ul><li>A <a href=#valid-date-string>valid date string</a>.</li>
<li>A <a href=#valid-global-date-and-time-string>valid global date and time string</a>.</li>
- </ul><p>A string is a <dfn id=valid-date-string-in-content-with-optional-time>valid date string in content with optional
- time</dfn> if it consists of zero or more <a href=#white_space>White_Space</a>
- characters, followed by a <a href=#valid-date-string-with-optional-time>valid date string with optional
- time</a>, followed by zero or more further
- <a href=#white_space>White_Space</a> characters.</p>
+ </ul><div class=impl>
- <div class=impl>
-
<hr><p>The rules to <dfn id=parse-a-date-or-time-string>parse a date or time string</dfn> are as
- follows. The algorithm is invoked with a flag indicating if the
- <i>in attribute</i> variant or the <i>in content</i> variant is to
- be used. The algorithm will return either a <a href=#concept-date title=concept-date>date</a>, a <a href=#concept-time title=concept-time>time</a>, a <a href=#concept-datetime title=concept-datetime>global date and time</a>, or nothing. If
+ follows. The algorithm will return either a <a href=#concept-date title=concept-date>date</a>, a <a href=#concept-time title=concept-time>time</a>, a <a href=#concept-datetime title=concept-datetime>global date and time</a>, or nothing. If
at any point the algorithm says that it "fails", this means that it
is aborted at that point and returns nothing.</p>
@@ -6199,9 +6704,6 @@
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
string.</li>
- <li><p>For the <i>in content</i> variant: <a href=#skip-white_space-characters>skip White_Space
- characters</a>.</li>
-
<li><p>Set <var title="">start position</var> to the same position
as <var title="">position</var>.</li>
@@ -6235,9 +6737,6 @@
time-zone offset component</a> to obtain <var title="">timezone<sub title="">hours</sub></var> and <var title="">timezone<sub title="">minutes</sub></var>. If this returns
nothing, then fail.</p>
- <li><p>For the <i>in content</i> variant: <a href=#skip-white_space-characters>skip White_Space
- characters</a>.</li>
-
<li><p>If <var title="">position</var> is <em>not</em> beyond the
end of <var title="">input</var>, then fail.</li>
@@ -7836,7 +8335,7 @@
<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
characters that immediately follow the word "<code title="">charset</code>" (there might not be any).</li>
- <li><p>If the next character is not a U+003D EQUALS SIGN ('='),
+ <li><p>If the next character is not a U+003D EQUALS SIGN (=),
then move <var title="">position</var> to point just before that
next character, and jump back to the step labeled
<i>loop</i>.</li>
@@ -7849,12 +8348,12 @@
<p>Process the next character as follows:</p>
- <dl class=switch><dt>If it is a U+0022 QUOTATION MARK ('"') and there is a later U+0022 QUOTATION MARK ('"') in <var title="">s</var></dt>
- <dt>If it is a U+0027 APOSTROPHE ("'") and there is a later U+0027 APOSTROPHE ("'") in <var title="">s</var></dt>
+ <dl class=switch><dt>If it is a U+0022 QUOTATION MARK (") and there is a later U+0022 QUOTATION MARK (") in <var title="">s</var></dt>
+ <dt>If it is a U+0027 APOSTROPHE (') and there is a later U+0027 APOSTROPHE (') in <var title="">s</var></dt>
<dd>Return the encoding corresponding to the string between this character and the next earliest occurrence of this character.</dd>
- <dt>If it is an unmatched U+0022 QUOTATION MARK ('"')</dt>
- <dt>If it is an unmatched U+0027 APOSTROPHE ("'")</dt>
+ <dt>If it is an unmatched U+0022 QUOTATION MARK (")</dt>
+ <dt>If it is an unmatched U+0027 APOSTROPHE (')</dt>
<dt>If there is no next character</dt>
<dd>Return nothing.</dd>
@@ -11563,6 +12062,7 @@
<li><code><a href=#svg>svg</a></code></li>
<li><code><a href=#the-table-element>table</a></code></li>
<li><code><a href=#the-textarea-element>textarea</a></code></li>
+ <li><code><a href=#the-time-element>time</a></code></li>
<li><code><a href=#the-u-element>u</a></code></li>
<li><code><a href=#the-ul-element>ul</a></code></li>
<li><code><a href=#the-var-element>var</a></code></li>
@@ -11663,6 +12163,7 @@
<li><code><a href=#the-sub-and-sup-elements>sup</a></code></li>
<li><code><a href=#svg>svg</a></code></li>
<li><code><a href=#the-textarea-element>textarea</a></code></li>
+ <li><code><a href=#the-time-element>time</a></code></li>
<li><code><a href=#the-u-element>u</a></code></li>
<li><code><a href=#the-var-element>var</a></code></li>
<li><code><a href=#the-video-element>video</a></code></li>
@@ -11970,6 +12471,7 @@
<li><code><a href=#svg>svg</a></code></li>
<li><code><a href=#the-table-element>table</a></code></li>
<li><code><a href=#the-textarea-element>textarea</a></code></li>
+ <li><code><a href=#the-time-element>time</a></code></li>
<li><code><a href=#the-u-element>u</a></code></li>
<li><code><a href=#the-ul-element>ul</a></code> (if the element's children include at least one <code><a href=#the-li-element>li</a></code> element)</li>
<li><code><a href=#the-var-element>var</a></code></li>
@@ -14588,8 +15090,9 @@
page.</li>
<li><p>If the character in <var title="">input</var> pointed to
- by <var title="">position</var> is a U+003B SEMICOLON ("<code title="">;</code>"), then advance <var title="">position</var> to
- the next character. Otherwise, jump to the last step.</li>
+ by <var title="">position</var> is a U+003B SEMICOLON (;), then
+ advance <var title="">position</var> to the next character.
+ Otherwise, jump to the last step.</li>
<li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
@@ -14614,8 +15117,9 @@
<li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
<li><p>If the character in <var title="">input</var> pointed to
- by <var title="">position</var> is a U+003D EQUALS SIGN ("<code title="">=</code>"), then advance <var title="">position</var> to
- the next character. Otherwise, jump to the last step.</li>
+ by <var title="">position</var> is a U+003D EQUALS SIGN (=), then
+ advance <var title="">position</var> to the next character.
+ Otherwise, jump to the last step.</li>
<li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
@@ -17026,7 +17530,7 @@
<em>...more content...</em>
</div>
<footer>
- <p>Posted <data itemprop="datePublished" value="2009-10-10">Thursday</data>.</p>
+ <p>Posted <time itemprop="datePublished" datetime="2009-10-10">Thursday</time>.</p>
</footer>
</article>
<em>...more blog posts...</em>
@@ -17178,7 +17682,7 @@
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 itemprop="headline">The Very First Rule of Life</h1>
- <p><data itemprop="datePublished" value="2009-10-09">3 days ago</data></p>
+ <p><time itemprop="datePublished" datetime="2009-10-09">3 days ago</time></p>
<link itemprop="url" href="?comments=0">
</header>[
<p>If there's a microphone anywhere near you, assume it's hot and
@@ -17194,7 +17698,7 @@
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 itemprop="headline">The Very First Rule of Life</h1>
- <p><data itemprop="datePublished" value="2009-10-09">3 days ago</data></p>
+ <p><time itemprop="datePublished" datetime="2009-10-09">3 days ago</time></p>
<link itemprop="url" href="?comments=0">
</header>
<p>If there's a microphone anywhere near you, assume it's hot and
@@ -17208,7 +17712,7 @@
<p>Posted by: <span itemprop="creator" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">George Washington</span>
</span></p>
- <p><data itemprop="commentTime" value="2009-10-10">15 minutes ago</data></p>
+ <p><time itemprop="commentTime" datetime="2009-10-10">15 minutes ago</time></p>
</footer>
<p>Yeah! Especially when talking about your lobbyist friends!</p>
</article>
@@ -17218,7 +17722,7 @@
<p>Posted by: <span itemprop="creator" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">George Hammond</span>
</span></p>
- <p><data itemprop="commentTime" value="2009-10-10">5 minutes ago</data></p>
+ <p><time itemprop="commentTime" datetime="2009-10-10">5 minutes ago</time></p>
</footer>
<p>Hey, you have the same first name as me.</p>
</article>
@@ -17695,7 +18199,7 @@
<P><A HREF="/fm/015.ogv">Download video</A>.</P>
</VIDEO>
<FOOTER> <!-- footer for article -->
- <P>Published <DATA VALUE="2009-10-21T18:26-07:00">on 2009/10/21 at 6:26pm</DATA></P>
+ <P>Published <TIME DATETIME="2009-10-21T18:26-07:00">on 2009/10/21 at 6:26pm</TIME></P>
</FOOTER>
</ARTICLE>
<ARTICLE>
@@ -17704,7 +18208,7 @@
<P>It is fun to see them pull some coal cars because they look so
dwarfed in comparison.</P>
<FOOTER> <!-- footer for article -->
- <P>Published <DATA VALUE="2009-09-15T14:54-07:00">on 2009/09/15 at 2:54pm</DATA></P>
+ <P>Published <TIME DATETIME="2009-09-15T14:54-07:00">on 2009/09/15 at 2:54pm</TIME></P>
</FOOTER>
</ARTICLE>
<FOOTER> <!-- site wide footer -->
@@ -20525,6 +21029,9 @@
attribute must be present. Its value must be a representation of the
element's contents in a machine-readable format.</p>
+ <p class=note>When the value is date- or time-related, the more
+ specific <code><a href=#the-time-element>time</a></code> element can be used instead.</p>
+
<p>The element can be used for several purposes.</p>
<p>When combined with microformats or the <a href=#microdata>microdata attributes</a> defined in this
@@ -20551,16 +21058,255 @@
<div class=example>
- <p>The <code><a href=#the-data-element>data</a></code> element can be used to encode dates, for
+ <p>Here, a short table has its numeric values encoded using
+ <code><a href=#the-data-element>data</a></code> so that a script can provide a sorting mechanism
+ on each column, despite the numbers being presented in textual
+ form in one column and in a decomposed form in another.</p>
+
+ <pre><table class="sortable"> <!-- class used by script to find tables to which to add sorting controls -->
+ <thead> <tr> <th> Game <th> Corporations <th> Map Size
+ <tbody>
+ <tr> <td> 1830 <td> <data value="8">Eight</data> <td> <data value="93">19+74 hexes (93 total)</data>
+ <tr> <td> 1856 <td> <data value="11">Eleven</data> <td> <data value="99">12+87 hexes (99 total)</data>
+ <tr> <td> 1870 <td> <data value="10">Ten</data> <td> <data value="149">4+145 hexes (149 total)</data>
+</table></pre>
+
+ </div>
+
+
+
+
+ <h4 id=the-time-element><span class=secno>4.6.11 </span>The <dfn><code>time</code></dfn> element</h4>
+
+ <dl class=element><dt>Categories</dt>
+ <dd><a href=#flow-content>Flow content</a>.</dd>
+ <dd><a href=#phrasing-content>Phrasing content</a>.</dd>
+ <dd><a href=#palpable-content>Palpable content</a>.</dd>
+ <dt>Contexts in which this element can be used:</dt>
+ <dd>Where <a href=#phrasing-content>phrasing content</a> is expected.</dd>
+ <dt>Content model:</dt>
+ <dd><a href=#phrasing-content>Phrasing content</a>.</dd>
+ <dt>Content attributes:</dt>
+ <dd><a href=#global-attributes>Global attributes</a></dd>
+ <dd><code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code></dd>
+ <dt>DOM interface:</dt>
+ <dd>
+<pre class=idl>interface <dfn id=htmltimeelement>HTMLTimeElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
+ attribute DOMString <a href=#dom-time-datetime title=dom-time-datetime>datetime</a>;
+};</pre>
+ </dd>
+ </dl><p>The <code><a href=#the-time-element>time</a></code> element <a href=#represents>represents</a> its
+ contents, along with a machine-readable form of those contents in
+ the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute. The
+ kind of content is limited to various kinds of dates, times,
+ time-zone offsets, and durations, as described below.</p>
+
+ <p>The <dfn id=attr-time-datetime title=attr-time-datetime><code>datetime</code></dfn>
+ attribute may be present. If present, its value must be a
+ representation of the element's contents in a machine-readable
+ format.</p>
+
+ <p>A <code><a href=#the-time-element>time</a></code> element that does not have a <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content attribute must
+ not have any element descendants.</p>
+
+ <p>The <dfn id=datetime-value>datetime value</dfn> of a <code><a href=#the-time-element>time</a></code> element is
+ the value of the element's <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content attribute, if
+ it has one, or the element's <code><a href=#textcontent>textContent</a></code>, if it does
+ not.</p>
+
+ <p>The <a href=#datetime-value>datetime value</a> of a <code><a href=#the-time-element>time</a></code> element
+ must match one of the following syntaxes.</p>
+
+ <dl><dt>A <a href=#valid-month-string>valid month string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-11</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-date-string>valid date string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-11-12</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-yearless-date-string>valid yearless date string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>11-12</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-time-string>valid time string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>14:54</time></pre>
+ <pre class=example><time>14:54:39</time></pre>
+ <pre class=example><time>14:54:39.92922</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-local-date-and-time-string>valid local date and time string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-11-12T14:54</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39.92922</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-time-zone-offset-string>valid time-zone offset string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>Z</time></pre>
+ <pre class=example><time>+00:00</time></pre>
+ <pre class=example><time>-08:00</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-global-date-and-time-string>valid global date and time string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-11-12T14:54Z</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39Z</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39.92922Z</time></pre>
+ <pre class=example><time>2011-11-12T14:54+00:00</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39+00:00</time></pre>
+ <pre class=example><time>2011-11-12T14:54:39.92922+00:00</time></pre>
+ <pre class=example><time>2011-11-12T06:54-08:00</time></pre>
+ <pre class=example><time>2011-11-12T06:54:39-08:00</time></pre>
+ <pre class=example><time>2011-11-12T06:54:39.92922-08:00</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-week-string>valid week string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>2011-W46</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-non-negative-integer>valid non-negative integer</a> representing a year</dt>
+
+ <dd>
+
+ <pre class=example><time>2011</time></pre>
+
+ </dd>
+
+
+ <dt>A <a href=#valid-duration-string>valid duration string</a></dt>
+
+ <dd>
+
+ <pre class=example><time>PT4H18M3S</time></pre>
+
+ <pre class=example><time>4h 18m 3s</time></pre>
+
+ </dd>
+
+ </dl><div class=impl>
+
+ <p>The machine-readable equivalent of the element's contents must be
+ obtained from the element's <a href=#datetime-value>datetime value</a> by using the
+ following algorithm:</p>
+
+ <ol><li><p>If <a href=#parse-a-month-string title="parse a month string">parsing a month
+ string</a> from the element's <a href=#datetime-value>datetime value</a>, if
+ The machine-readable equivalent is the <a href=#concept-month title=concept-month>month</a>, that is the machine-readable
+ equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-date-string title="parse a date string">parsing a date
+ string</a> from the element's <a href=#datetime-value>datetime value</a>, if
+ The machine-readable equivalent is the <a href=#concept-date title=concept-date>date</a>, that is the machine-readable
+ equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-yearless-date-string title="parse a yearless date string">parsing a
+ yearless date string</a> from the element's <a href=#datetime-value>datetime
+ value</a> returns a <a href=#concept-yearless-date title=concept-yearless-date>yearless date</a>, that is the
+ machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-time-string title="parse a time string">parsing a time
+ string</a> from the element's <a href=#datetime-value>datetime value</a>,
+ returns a <a href=#concept-time title=concept-time>time</a>, that is the
+ machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-local-date-and-time-string title="parse a local date and time string">parsing
+ a local date and time string</a> from the element's
+ <a href=#datetime-value>datetime value</a> returns a <a href=#concept-datetime-local title=concept-datetime-local>local date and time</a>, that is
+ the machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-time-zone-offset-string title="parse a time-zone offset string">parsing a
+ time-zone offset string</a> from the element's <a href=#datetime-value>datetime
+ value</a>, returns a <a href=#concept-timezone title=concept-timezone>time-zone
+ offset</a>, that is the machine-readable equivalent; abort
+ these steps.</li>
+
+ <li><p>If <a href=#parse-a-global-date-and-time-string title="parse a global date and time
+ string">parsing a global date and time string</a> from the
+ element's <a href=#datetime-value>datetime value</a> returns a <a href=#concept-datetime title=concept-datetime>global date and time</a>, that is the
+ machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If <a href=#parse-a-week-string title="parse a week string">parsing a week
+ string</a> from the element's <a href=#datetime-value>datetime value</a>,
+ returns a <a href=#concept-week title=concept-week>week</a>, that is the
+ machine-readable equivalent; abort these steps.</li>
+
+ <li><p>If the element's <a href=#datetime-value>datetime value</a> consists of
+ only characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
+ NINE (9), then the machine-readable equivalent is the base-ten
+ interpretation of those digits, representing a year; abort these
+ steps.</li>
+
+ <li><p>If <a href=#parse-a-duration-string title="parse a duration string">parsing a duration
+ string</a> from the element's <a href=#datetime-value>datetime value</a>,
+ returns a <a href=#concept-duration title=concept-duration>duration</a>, that is
+ the machine-readable equivalent; abort these steps.</li>
+
+ <li><p>There is no machine-readable equivalent.</li>
+
+ </ol><p class=note>The algorithms referenced above are intended to be
+ designed such that for any arbitrary string <var title="">s</var>,
+ only one of the algorithms returns a value. A more efficient
+ approach might be to create a single algorithm that parses all these
+ data types in one pass; developing such an algorithm is left as an
+ exercise to the reader.</p>
+
+ <p>The <dfn id=dom-time-datetime title=dom-time-datetime><code>datetime</code></dfn>
+ IDL attribute must <a href=#reflect>reflect</a> the content attribute of the
+ same name.</p>
+
+ </div>
+
+ <div class=example>
+
+ <p>The <code><a href=#the-time-element>time</a></code> element can be used to encode dates, for
example in microformats. The following shows a hypothetical way of
encoding an event using a variant on hCalendar that uses the
- <code><a href=#the-data-element>data</a></code> element:</p>
+ <code><a href=#the-time-element>time</a></code> element:</p>
<pre><div class="vevent">
<a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
<span class="summary">Web 2.0 Conference</span>:
- <data class="dtstart" value="2007-10-05">October 5</data> -
- <data class="dtend" value="2007-10-20">19</data>,
+ <time class="dtstart" datetime="2007-10-05">October 5</time> -
+ <time class="dtend" datetime="2007-10-20">19</time>,
at the <span class="location">Argent Hotel, San Francisco, CA</span>
</div></pre>
@@ -20573,12 +21319,12 @@
<div class=example>
<p>In this example, an article's publication date is marked up
- using <code><a href=#the-data-element>data</a></code> and the schema.org microdata
+ using <code><a href=#the-time-element>time</a></code> and the schema.org microdata
vocabulary:</p>
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<h1 itemprop="headline">Small tasks</h1>
- <footer>Published <data itemprop="datePublished" value="2009-08-30">yesterday</data>.</footer>
+ <footer>Published <time itemprop="datePublished" datetime="2009-08-30">yesterday</time>.</footer>
<p itemprop="articleBody">I put a bike bell on his bike.</p>
</article></pre>
@@ -20586,45 +21332,48 @@
<div class=example>
- <p>In the following snippet, the <code><a href=#the-data-element>data</a></code> element is used
+ <p>In the following snippet, the <code><a href=#the-time-element>time</a></code> element is used
to encode a date in the ISO8601 format, for later processing by a
script:</p>
- <pre><p>Our first date was <data value="2006-09-23">a Saturday</data>.</p></pre>
+ <pre><p>Our first date was <time datetime="2006-09-23">a Saturday</time>.</p></pre>
<p>In this second snippet, the value includes a time:</p>
- <pre><p>We stopped talking at <data value="2006-09-24T05:00-07:00">5am the next morning</data>.</p></pre>
+ <pre><p>We stopped talking at <time datetime="2006-09-24T05:00-07:00">5am the next morning</time>.</p></pre>
<p>A script loaded by the page (and thus privy to the page's
internal convention of marking up dates and times using the
- <code><a href=#the-data-element>data</a></code> element) could scan through the page and look at
- all the <code><a href=#the-data-element>data</a></code> elements therein to create an index of
+ <code><a href=#the-time-element>time</a></code> element) could scan through the page and look at
+ all the <code><a href=#the-time-element>time</a></code> elements therein to create an index of
dates and times.</p>
</div>
<div class=example>
- <p>Here, a short table has its numeric values encoded using
- <code><a href=#the-data-element>data</a></code> so that a script can provide a sorting mechanism
- on each column, despite the numbers being presented in textual
- form in one column and in a decomposed form in another.</p>
+ <p>For example, this element conveys the string "Tuesday" with
+ the additional semantic that the 12th of November 2011 is the
+ meaning that corresponds to "Tuesday":</p>
- <pre><table class="sortable"> <!-- class used by script to find tables to which to add sorting controls -->
- <thead> <tr> <th> Game <th> Corporations <th> Map Size
- <tbody>
- <tr> <td> 1830 <td> <data value="8">Eight</data> <td> <data value="93">19+74 hexes (93 total)</data>
- <tr> <td> 1856 <td> <data value="11">Eleven</data> <td> <data value="99">12+87 hexes (99 total)</data>
- <tr> <td> 1870 <td> <data value="10">Ten</data> <td> <data value="149">4+145 hexes (149 total)</data>
-</table></pre>
+ <pre>Today is <time datetime="2011-11-12">Tuesday</time>.</pre>
</div>
+ <div class=example>
+ <p>In this example, a specific time in the Pacific Standard Time
+ timezone is specified:</p>
- <h4 id=the-code-element><span class=secno>4.6.11 </span>The <dfn><code>code</code></dfn> element</h4>
+ <pre>Your next meeting is at <time datetime="2011-11-12T15:00-08:00">3pm</time>.</pre>
+ </div>
+
+
+
+
+ <h4 id=the-code-element><span class=secno>4.6.12 </span>The <dfn><code>code</code></dfn> element</h4>
+
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
<dd><a href=#phrasing-content>Phrasing content</a>.</dd>
@@ -20686,7 +21435,7 @@
<p class=note>See the <code><a href=#the-pre-element>pre</a></code> element for more details.</p>
- <h4 id=the-var-element><span class=secno>4.6.12 </span>The <dfn><code>var</code></dfn> element</h4>
+ <h4 id=the-var-element><span class=secno>4.6.13 </span>The <dfn><code>var</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20757,7 +21506,7 @@
</div>
- <h4 id=the-samp-element><span class=secno>4.6.13 </span>The <dfn><code>samp</code></dfn> element</h4>
+ <h4 id=the-samp-element><span class=secno>4.6.14 </span>The <dfn><code>samp</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20796,7 +21545,7 @@
</div>
- <h4 id=the-kbd-element><span class=secno>4.6.14 </span>The <dfn><code>kbd</code></dfn> element</h4>
+ <h4 id=the-kbd-element><span class=secno>4.6.15 </span>The <dfn><code>kbd</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20848,7 +21597,7 @@
</div>
- <h4 id=the-sub-and-sup-elements><span class=secno>4.6.15 </span>The <dfn id=the-sub-element><code>sub</code></dfn> and <dfn id=the-sup-element><code>sup</code></dfn> elements</h4>
+ <h4 id=the-sub-and-sup-elements><span class=secno>4.6.16 </span>The <dfn id=the-sub-element><code>sub</code></dfn> and <dfn id=the-sup-element><code>sup</code></dfn> elements</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20911,7 +21660,7 @@
- <h4 id=the-i-element><span class=secno>4.6.16 </span>The <dfn><code>i</code></dfn> element</h4>
+ <h4 id=the-i-element><span class=secno>4.6.17 </span>The <dfn><code>i</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -20972,7 +21721,7 @@
necessarily be italicized.</p>
- <h4 id=the-b-element><span class=secno>4.6.17 </span>The <dfn><code>b</code></dfn> element</h4>
+ <h4 id=the-b-element><span class=secno>4.6.18 </span>The <dfn><code>b</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21048,7 +21797,7 @@
- <h4 id=the-u-element><span class=secno>4.6.18 </span>The <dfn><code>u</code></dfn> element</h4>
+ <h4 id=the-u-element><span class=secno>4.6.19 </span>The <dfn><code>u</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21088,7 +21837,7 @@
- <h4 id=the-mark-element><span class=secno>4.6.19 </span>The <dfn><code>mark</code></dfn> element</h4>
+ <h4 id=the-mark-element><span class=secno>4.6.20 </span>The <dfn><code>mark</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21237,7 +21986,7 @@
</div>
- <h4 id=the-ruby-element><span class=secno>4.6.20 </span>The <dfn><code>ruby</code></dfn> element</h4>
+ <h4 id=the-ruby-element><span class=secno>4.6.21 </span>The <dfn><code>ruby</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21317,7 +22066,7 @@
<!-- Note: Examples are 32px/16px Stone Sans Sem ITC TT -->
- <h4 id=the-rt-element><span class=secno>4.6.21 </span>The <dfn><code>rt</code></dfn> element</h4>
+ <h4 id=the-rt-element><span class=secno>4.6.22 </span>The <dfn><code>rt</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd>None.</dd>
@@ -21347,7 +22096,7 @@
</div>
- <h4 id=the-rp-element><span class=secno>4.6.22 </span>The <dfn><code>rp</code></dfn> element</h4>
+ <h4 id=the-rp-element><span class=secno>4.6.23 </span>The <dfn><code>rp</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd>None.</dd>
@@ -21396,7 +22145,7 @@
</div>
- <h4 id=the-bdi-element><span class=secno>4.6.23 </span>The <dfn><code>bdi</code></dfn> element</h4>
+ <h4 id=the-bdi-element><span class=secno>4.6.24 </span>The <dfn><code>bdi</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21461,7 +22210,7 @@
</div>
- <h4 id=the-bdo-element><span class=secno>4.6.24 </span>The <dfn><code>bdo</code></dfn> element</h4>
+ <h4 id=the-bdo-element><span class=secno>4.6.25 </span>The <dfn><code>bdo</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21512,7 +22261,7 @@
- <h4 id=the-span-element><span class=secno>4.6.25 </span>The <dfn><code>span</code></dfn> element</h4>
+ <h4 id=the-span-element><span class=secno>4.6.26 </span>The <dfn><code>span</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21552,7 +22301,7 @@
- <h4 id=the-br-element><span class=secno>4.6.26 </span>The <dfn><code>br</code></dfn> element</h4>
+ <h4 id=the-br-element><span class=secno>4.6.27 </span>The <dfn><code>br</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21634,7 +22383,7 @@
</div>
- <h4 id=the-wbr-element><span class=secno>4.6.27 </span>The <dfn><code>wbr</code></dfn> element</h4>
+ <h4 id=the-wbr-element><span class=secno>4.6.28 </span>The <dfn><code>wbr</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
<dd><a href=#flow-content>Flow content</a>.</dd>
@@ -21685,7 +22434,7 @@
- <h4 id=usage-summary><span class=secno>4.6.28 </span>Usage summary</h4>
+ <h4 id=usage-summary><span class=secno>4.6.29 </span>Usage summary</h4>
<p><i>This section is non-normative.</i></p>
@@ -21732,6 +22481,10 @@
<td>Machine-readable equivalent
<td><pre class=example>Available starting today! <strong><data value="UPC:022014640201">North Coast Organic Apple Cider</data></strong></pre>
+ <tr><td><code><a href=#the-time-element>time</a></code>
+ <td>Machine-readable equivalent of date- or time-related data
+ <td><pre class=example>Available starting on <strong><time datetime="2011-11-12">November 12th</time></strong>!</pre>
+
<tr><td><code><a href=#the-code-element>code</a></code>
<td>Computer code
<td><pre class=example>The <strong><code>fruitdb</code></strong> program can be used for tracking fruit production.</pre>
@@ -56696,7 +57449,14 @@
<p>The following extract shows how an IM conversation log could be
marked up, using the <code><a href=#the-data-element>data</a></code> element to provide Unix
- timestamps for each line.</p>
+ timestamps for each line. Note that the timestamps are provided in
+ a format that the <code><a href=#the-time-element>time</a></code> element does not support, so
+ the <code><a href=#the-data-element>data</a></code> element is used instead (namely, Unix <code title="">time_t</code> timestamps). Had the author wished to mark
+ up the data using one of the date and time formats supported by the
+ <code><a href=#the-time-element>time</a></code> element, that element could have been used
+ instead of <code><a href=#the-data-element>data</a></code>. This could be advantageous as it
+ would allow data analysis tools to detect the timestamps
+ unambiguously, without coordination with the page author.</p>
<pre><p> <data value="1319898155">14:22</data> <b>egof</b> I'm not that nerdy, I've only seen 30% of the star trek episodes
<p> <data value="1319898192">14:23</data> <b>kaj</b> if you know what percentage of the star trek episodes you have seen, you are inarguably nerdy
@@ -57449,11 +58209,27 @@
<div class=example>
+ <p>Here, there is an item with a property whose value is a product
+ ID. The ID is not human-friendly, so the product's name is used
+ the human-visible text instead of the ID.</p>
+
+ <pre><h1 itemscope>
+ <data itemprop="product-id" value="9678AOU879">The Instigator 2000</data>
+</h1></pre>
+
+ </div>
+
+ <p>For date- and time-related data, the <code><a href=#the-time-element>time</a></code> element
+ and its <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute
+ can be used instead.</p>
+
+ <div class=example>
+
<p>In this example, the item has one property, "birthday", whose
value is a date:</p>
<pre><div itemscope>
- I was born on <data itemprop="birthday" value="2009-05-10">May 10th 2009</data>.
+ I was born on <time itemprop="birthday" datetime="2009-05-10">May 10th 2009</time>.
</div></pre>
</div>
@@ -57661,7 +58437,7 @@
<dt>Author
<dd itemprop="author">Peter F. Hamilton
<dt>Publication date
- <dd><data itemprop="pubdate" value="1996-01-26">26 January 1996</data>
+ <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time>
</dl></pre>
<p>The "<code title="">http://vocab.example.net/book</code>"
@@ -58272,6 +59048,12 @@
the empty string otherwise.</dd>
+ <dt>If the element is a <code><a href=#the-time-element>time</a></code> element</dt>
+
+ <dd><p>The value is the element's <a href=#datetime-value>datetime
+ value</a>.</dd>
+
+
<dt>Otherwise</dt>
<dd><p>The value is the element's
@@ -58581,6 +59363,15 @@
<dd><p>The attribute must act as it would if it was <a href=#reflect title=reflect>reflecting</a> the element's <code title=attr-data-value><a href=#attr-data-value>value</a></code> content attribute.</dd>
+ <dt>If the element is a <code><a href=#the-time-element>time</a></code> element</dt>
+
+ <dd><p>On getting, if the element has a <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content attribute, the
+ IDL attribute must return that content attribute's value;
+ otherwise, it must return the element's <code><a href=#textcontent>textContent</a></code>.
+ On setting, the IDL attribute must act as it would if it was <a href=#reflect title=reflect>reflecting</a> the element's <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content
+ attribute.</dd>
+
+
<dt>Otherwise</dt>
<dd><p>The attribute must act the same as the element's
@@ -60972,8 +61763,8 @@
...
<h1 itemprop="summary">Bluesday Tuesday: Money Road</h1>
...
- <data itemprop="dtstart" value="2009-05-05T19:00:00Z">May 5th @ 7pm</data>
- (until <data itemprop="dtend" value="2009-05-05T21:00:00Z">9pm</data>)
+ <time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th @ 7pm</time>
+ (until <time itemprop="dtend" datetime="2009-05-05T21:00:00Z">9pm</time>)
...
<a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
rel="bookmark" itemprop="url">Link to this page</a>
@@ -61034,8 +61825,8 @@
<pre><div itemscope itemtype="http://microformats.org/profile/hcalendar#vevent">
<p>I'm going to
<strong itemprop="summary">Bluesday Tuesday: Money Road</strong>,
- <data itemprop="dtstart" value="2009-05-05T19:00:00Z">May 5th at 7pm</data>
- to <data itemprop="dtend" value="2009-05-05T21:00:00Z">9pm</data>,
+ <time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th at 7pm</time>
+ to <time itemprop="dtend" datetime="2009-05-05T21:00:00Z">9pm</time>,
at <span itemprop="location">The RoadHouse</span>!</p>
<p><a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
itemprop="url">See this event on livebrum.co.uk</a>.</p>
@@ -98187,6 +98978,8 @@
<p><i>This section is non-normative.</i></p>
+ <!-- XXX this index doesn't list the palpable elements -->
+
<table><caption>List of elements</caption>
<thead><tr><th> Element
<th> Description
@@ -99242,6 +100035,15 @@
<td><code><a href=#the-tr-element>tr</a></code></td>
<td><a href=#global-attributes title="global attributes">globals</a></td>
<td><code><a href=#htmltablesectionelement>HTMLTableSectionElement</a></code></td>
+ <tr><th><code><a href=#the-time-element>time</a></code></th>
+ <td>Machine-readable equivalent of date- or time-related data</td>
+ <td><a href=#flow-content title="Flow content">flow</a>;
+ <a href=#phrasing-content title="Phrasing content">phrasing</a></td>
+ <td><a href=#phrasing-content title="Phrasing content">phrasing</a></td>
+ <td><a href=#phrasing-content title="Phrasing content">phrasing</a></td>
+ <td><a href=#global-attributes title="global attributes">globals</a>;
+ <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code></td>
+ <td><code><a href=#htmltimeelement>HTMLTimeElement</a></code></td>
<tr><th><code><a href=#the-title-element>title</a></code></th>
<td>Document title</td>
<td><a href=#metadata-content title="Metadata content">metadata</a></td>
@@ -99439,6 +100241,7 @@
<code><a href=#svg>svg</a></code>;
<code><a href=#the-table-element>table</a></code>;
<code><a href=#the-textarea-element>textarea</a></code>;
+ <code><a href=#the-time-element>time</a></code>;
<code><a href=#the-u-element>u</a></code>;
<code><a href=#the-ul-element>ul</a></code>;
<code><a href=#the-var-element>var</a></code>;
@@ -99519,6 +100322,7 @@
<code><a href=#the-sub-and-sup-elements>sup</a></code>;
<code><a href=#svg>svg</a></code>;
<code><a href=#the-textarea-element>textarea</a></code>;
+ <code><a href=#the-time-element>time</a></code>;
<code><a href=#the-u-element>u</a></code>;
<code><a href=#the-var-element>var</a></code>;
<code><a href=#the-video-element>video</a></code>;
@@ -99707,6 +100511,7 @@
<code><a href=#svg>svg</a></code>;
<code><a href=#the-table-element>table</a></code>;
<code><a href=#the-textarea-element>textarea</a></code>;
+ <code><a href=#the-time-element>time</a></code>;
<code><a href=#the-u-element>u</a></code>;
<code><a href=#the-var-element>var</a></code>;
<code><a href=#the-video-element>video</a></code>
@@ -99849,6 +100654,19 @@
<code title=attr-mod-datetime><a href=#attr-mod-datetime>ins</a></code>
<td> Date and (optionally) time of the change
<td> <a href=#valid-date-string-with-optional-time>Valid date string with optional time</a>
+ <tr><th> <code title="">datetime</code>
+ <td> <code title=attr-time-datetime><a href=#attr-time-datetime>time</a></code>
+ <td> Machine-readable value
+ <td> <a href=#valid-month-string>Valid month string</a>,
+ <a href=#valid-date-string>valid date string</a>,
+ <a href=#valid-yearless-date-string>valid yearless date string</a>,
+ <a href=#valid-time-string>valid time string</a>,
+ <a href=#valid-local-date-and-time-string>valid local date and time string</a>,
+ <a href=#valid-time-zone-offset-string>valid time-zone offset string</a>,
+ <a href=#valid-global-date-and-time-string>valid global date and time string</a>,
+ <a href=#valid-week-string>valid week string</a>,
+ <a href=#valid-non-negative-integer>valid non-negative integer</a>, or
+ <a href=#valid-duration-string>valid duration string</a>
<tr><th> <code title="">default</code>
<td> <code title=attr-track-default><a href=#attr-track-default>track</a></code>
<td> Enable the track if no other <a href=#text-track>text track</a> is more suitable.
@@ -100352,11 +101170,6 @@
"<code title=attr-button-type-reset><a href=#attr-button-type-reset>reset</a></code>";
"<code title=attr-button-type-button><a href=#attr-button-type-button>button</a></code>"
<tr><th> <code title="">type</code>
- <td> <code title=attr-button-type><a href=#attr-button-type>button</a></code>;
- <code title=attr-input-type><a href=#attr-input-type>input</a></code>
- <td> Type of form control
- <td> <a href=#attr-input-type title=attr-input-type><code>input</code> type keyword</a>
- <tr><th> <code title="">type</code>
<td> <code title=attr-command-type><a href=#attr-command-type>command</a></code>
<td> Type of command
<td> "<code title=attr-command-type-keyword-command><a href=#attr-command-type-keyword-command>command</a></code>";
@@ -100371,6 +101184,10 @@
<td> Type of embedded resource
<td> <a href=#valid-mime-type>Valid MIME type</a>
<tr><th> <code title="">type</code>
+ <td> <code title=attr-input-type><a href=#attr-input-type>input</a></code>
+ <td> Type of form control
+ <td> <a href=#attr-input-type title=attr-input-type><code>input</code> type keyword</a>
+ <tr><th> <code title="">type</code>
<td> <code title=attr-menu-type><a href=#attr-menu-type>menu</a></code>
<td> Type of menu
<td> "<code title="context menu state"><a href=#context-menu-state>context</a></code>"; "<code title="toolbar state"><a href=#toolbar-state>toolbar</a></code>"
@@ -100389,7 +101206,7 @@
<td> Value to be used for <a href=#form-submission>form submission</a>
<td> <a href=#attribute-text>Text</a>
<tr><th> <code title="">value</code>
- <td> <code title=attr-data-value><a href=#attr-data-value>input</a></code>
+ <td> <code title=attr-data-value><a href=#attr-data-value>data</a></code>
<td> Machine-readable value
<td> <a href=#attribute-text>Text</a>*
<tr><th> <code title="">value</code>
@@ -101120,6 +101937,9 @@
<tr><td> <code><a href=#the-thead-element>thead</a></code>
<td> <code><a href=#htmltablesectionelement>HTMLTableSectionElement</a></code> : <code><a href=#htmlelement>HTMLElement</a></code>
+ <tr><td> <code><a href=#the-time-element>time</a></code>
+ <td> <code><a href=#htmltimeelement>HTMLTimeElement</a></code> : <code><a href=#htmlelement>HTMLElement</a></code>
+
<tr><td> <code><a href=#the-title-element>title</a></code>
<td> <code><a href=#htmltitleelement>HTMLTitleElement</a></code> : <code><a href=#htmlelement>HTMLElement</a></code>
Modified: source
===================================================================
--- source 2011-11-12 00:22:15 UTC (rev 6826)
+++ source 2011-11-18 19:43:57 UTC (rev 6827)
@@ -4955,6 +4955,119 @@
</div>
+ <h5>Yearless dates</h5>
+
+ <p>A <dfn title="concept-yearless-date">yearless date</dfn> consists
+ of a month and a day, but with no associated year.</p>
+
+ <p>A string is a <dfn>valid yearless date string</dfn> representing
+ a month <var title="">month</var> and a day <var title="">day</var>
+ if it consists of the following components in the given order:</p>
+
+ <ol>
+
+ <li>Optionally, two U+002D HYPHEN-MINUS characters (-)</li>
+
+ <li>Two <span title="concept-datetime-digit">digits</span>,
+ representing the month <var title="">month</var>, in the range
+ 1 ≤ <var
+ title="">month</var> ≤ 12</li>
+
+ <li>A U+002D HYPHEN-MINUS character (-)</li>
+
+ <li>Two <span title="concept-datetime-digit">digits</span>,
+ representing <var title="">day</var>, in the range
+ 1 ≤ <var title="">day</var> ≤ <var
+ title="">maxday</var> where <var title="">maxday</var> is the <span
+ title="number of days in month month of year year">number of
+ days</span> in the month <var title="">month</var> and any
+ arbitrary leap year (e.g. 4 or 2000)</li>
+
+ </ol>
+
+ <p class="note">In other words, if the <var title="">month</var> is
+ "<code title="">02</code>", meaning February, then the day can be
+ 29, as if the year was a leap year.</p>
+
+ <div class="impl">
+
+ <p>The rules to <dfn>parse a yearless date string</dfn> are as
+ follows. This will return either a month and a day, or nothing. If
+ at any point the algorithm says that it "fails", this means that it
+ is aborted at that point and returns nothing.</p>
+
+ <ol>
+
+ <li><p>Let <var title="">input</var> be the string being
+ parsed.</p></li>
+
+ <li><p>Let <var title="">position</var> be a pointer into <var
+ title="">input</var>, initially pointing at the start of the
+ string.</p></li>
+
+ <li><p><span>Parse a yearless date component</span> to obtain <var
+ title="">month</var> and <var title="">day</var>. If this returns
+ nothing, then fail.</p>
+
+ <li><p>If <var title="">position</var> is <em>not</em> beyond the
+ end of <var title="">input</var>, then fail.</p></li>
+
+ <li><p>Return <var title="">month</var> and <var
+ title="">day</var>.</p></li>
+
+ </ol>
+
+ <p>The rules to <dfn>parse a yearless date component</dfn>, given an
+ <var title="">input</var> string and a <var title="">position</var>,
+ are as follows. This will return either a month and a day, or
+ nothing. If at any point the algorithm says that it "fails", this
+ means that it is aborted at that point and returns nothing.</p>
+
+ <ol>
+
+ <li><p><span>Collect a sequence of characters</span> that are
+ U+002D HYPHEN-MINUS characters (-). If the collected sequence is
+ not exactly zero or two characters long, then fail.</p></li>
+
+ <li><p><span>Collect a sequence of characters</span> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then fail. Otherwise,
+ interpret the resulting sequence as a base-ten integer. Let that
+ number be the <var title="">month</var>.</p></li>
+
+ <li><p>If <var title="">month</var> is not a number in the range
+ 1 ≤ <var title="">month</var> ≤ 12, then
+ fail.</p></li>
+
+ <li><p>Let <var title="">maxday</var> be the <span title="number of
+ days in month month of year year">number of days</span> in month
+ <var title="">month</var> of any arbitrary leap year (e.g. 4 or
+ 2000).</p></li>
+
+ <li><p>If <var title="">position</var> is beyond the end of <var
+ title="">input</var> or if the character at <var
+ title="">position</var> is not a U+002D HYPHEN-MINUS character,
+ then fail. Otherwise, move <var title="">position</var> forwards
+ one character.</p></li>
+
+ <li><p><span>Collect a sequence of characters</span> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then fail. Otherwise,
+ interpret the resulting sequence as a base-ten integer. Let that
+ number be the <var title="">day</var>.</p></li>
+
+ <li><p>If <var title="">day</var> is not a number in the range
+ 1 ≤ <var title="">day</var> ≤ <var
+ title="">maxday</var>, then fail.</li>
+
+ <li><p>Return <var title="">month</var> and <var
+ title="">day</var>.</p></li>
+
+ </ol>
+
+ </div>
+
+
<h5>Times</h5>
<p>A <dfn title="concept-time">time</dfn> consists of a specific
@@ -5202,72 +5315,208 @@
</div>
+ <h5>Time zones</h5>
- <h5>Global dates and times</h5>
+ <p>A <dfn title="concept-timezone">time-zone offset</dfn> consists
+ of a signed number of hours and minutes.</p>
- <p>A <dfn title="concept-datetime">global date and time</dfn>
- consists of a specific proleptic Gregorian date, consisting of a
- year, a month, and a day, and a time, consisting of an hour, a
- minute, a second, and a fraction of a second, expressed with a
- time-zone offset, consisting of a signed number of hours and
- minutes. <a href="#refsGREGORIAN">[GREGORIAN]</a></p>
+ <p>A string is a <dfn>valid time-zone offset string</dfn>
+ representing a time-zone offset if it consists of either:</p>
- <p>A string is a <dfn>valid global date and time string</dfn>
- representing a date, time, and a time-zone offset if it consists of
- the following components in the given order:</p>
+ <ul>
+
+ <li><p>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only
+ if the time zone is UTC</p></li>
+
+ <li>
+
+ <p>Or, the following components, in the given order:</p>
+
+ <ol>
+
+ <li>Either a U+002B PLUS SIGN character (+) or, if the
+ time-zone offset is not zero, a U+002D HYPHEN-MINUS character
+ (-), representing the sign of the time-zone offset</li>
+ <!-- the -00:00 offset is disallowed because RFC3339 gives it a
+ special semantic -->
+
+ <li>Two <span title="concept-datetime-digit">digits</span>,
+ representing the hours component <var title="">hour</var> of
+ the time-zone offset, in the range 0 ≤ <var
+ title="">hour</var> ≤ 23</li>
+
+ <li>A U+003A COLON character (:)</li>
+
+ <li>Two <span title="concept-datetime-digit">digits</span>,
+ representing the minutes component <var title="">minute</var>
+ of the time-zone offset, in the range 0 ≤ <var
+ title="">minute</var> ≤ 59</li>
+
+ </ol>
+
+ </li>
+
+ </ul>
+
+ <p class="note">This format allows for time-zone offsets from -23:59
+ to +23:59. In practice, however, the range of offsets of actual time
+ zones is -12:00 to +14:00, and the minutes component of offsets of
+ actual time zones is always either 00, 30, or 45.</p>
+
+ <p class="note">See also the usage notes and examples in the <span
+ title="concept-datetime">global date and time</span> section below
+ for details on using time-zone offsets with historical times that
+ predate the formation of formal time zones.</p>
+
+ <div class="impl">
+
+ <p>The rules to <dfn>parse a time-zone offset string</dfn> are as
+ follows. This will return either a time-zone offset, or nothing. If
+ at any point the algorithm says that it "fails", this means that it
+ is aborted at that point and returns nothing.</p>
+
<ol>
- <li>A <span>valid date string</span> representing the date</li>
+ <li><p>Let <var title="">input</var> be the string being
+ parsed.</p></li>
- <li>A U+0054 LATIN CAPITAL LETTER T character (T)</li>
+ <li><p>Let <var title="">position</var> be a pointer into <var
+ title="">input</var>, initially pointing at the start of the
+ string.</p></li>
- <li>A <span>valid time string</span> representing the time</li>
+ <li><p><span>Parse a time-zone offset component</span> to obtain
+ <var title="">timezone<sub title="">hours</sub></var> and <var
+ title="">timezone<sub title="">minutes</sub></var>. If this returns
+ nothing, then fail.</p>
- <li>Either:
+ <li><p>If <var title="">position</var> is <em>not</em> beyond the
+ end of <var title="">input</var>, then fail.</p></li>
- <ul>
+ <li><p>Return the time-zone offset that is <var
+ title="">timezone<sub title="">hours</sub></var> hours and <var
+ title="">timezone<sub title="">minutes</sub></var> minutes from
+ UTC.</p></li>
- <li>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only
- if the time zone is UTC</li>
+ </ol>
- <li>Or:
+ <p>The rules to <dfn>parse a time-zone offset component</dfn>, given
+ an <var title="">input</var> string and a <var
+ title="">position</var>, are as follows. This will return either
+ time-zone hours and time-zone minutes, or nothing. If at any point
+ the algorithm says that it "fails", this means that it is aborted at
+ that point and returns nothing.</p>
- <ol>
+ <ol>
- <li>Either a U+002B PLUS SIGN character (+) or, if the
- time-zone offset is not zero, a U+002D HYPHEN-MINUS character
- (-), representing the sign of the time-zone offset</li>
- <!-- the -00:00 offset is disallowed because RFC3339 gives it a
- special semantic -->
+ <li>
- <li>Two <span title="concept-datetime-digit">digits</span>,
- representing the hours component <var title="">hour</var> of
- the time-zone offset, in the range 0 ≤ <var
- title="">hour</var> ≤ 23</li>
+ <p>If the character at <var title="">position</var> is a U+005A
+ LATIN CAPITAL LETTER Z character (Z), then:</p>
- <li>A U+003A COLON character (:)</li>
+ <ol>
- <li>Two <span title="concept-datetime-digit">digits</span>,
- representing the minutes component <var title="">minute</var>
- of the time-zone offset, in the range 0 ≤ <var
- title="">minute</var> ≤ 59</li>
+ <li><p>Let <var title="">timezone<sub title="">hours</sub></var>
+ be 0.</p></li>
- </ol>
+ <li><p>Let <var title="">timezone<sub
+ title="">minutes</sub></var> be 0.</p></li>
- </li>
+ <li><p>Advance <var title="">position</var> to the next character
+ in <var title="">input</var>.</p></li>
- </ul>
+ </ol>
+ <p>Otherwise, if the character at <var title="">position</var> is
+ either a U+002B PLUS SIGN (+) or a U+002D HYPHEN-MINUS (-),
+ then:</p>
+
+ <ol>
+
+ <li><p>If the character at <var title="">position</var> is a
+ U+002B PLUS SIGN (+), let <var title="">sign</var> be
+ "positive". Otherwise, it's a U+002D HYPHEN-MINUS (-); let <var
+ title="">sign</var> be "negative".</p></li>
+
+ <li><p>Advance <var title="">position</var> to the next character
+ in <var title="">input</var>.</p></li>
+
+ <li><p><span>Collect a sequence of characters</span> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then
+ fail. Otherwise, interpret the resulting sequence as a base-ten
+ integer. Let that number be the <var title="">timezone<sub
+ title="">hours</sub></var>.</p></li>
+
+ <li>If <var title="">timezone<sub title="">hours</sub></var> is
+ not a number in the range 0 ≤ <var
+ title="">timezone<sub
+ title="">hours</sub></var> ≤ 23, then fail.</li>
+
+ <li>If <var title="">sign</var> is "negative", then negate <var
+ title="">timezone<sub title="">hours</sub></var>.</li>
+
+ <li><p>If <var title="">position</var> is beyond the end of <var
+ title="">input</var> or if the character at <var
+ title="">position</var> is not a U+003A COLON character, then
+ fail. Otherwise, move <var title="">position</var> forwards one
+ character.</p></li>
+
+ <li><p><span>Collect a sequence of characters</span> in the range
+ U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
+ sequence is not exactly two characters long, then
+ fail. Otherwise, interpret the resulting sequence as a base-ten
+ integer. Let that number be the <var title="">timezone<sub
+ title="">minutes</sub></var>.</p></li>
+
+ <li>If <var title="">timezone<sub title="">minutes</sub></var> is
+ not a number in the range 0 ≤ <var
+ title="">timezone<sub
+ title="">minutes</sub></var> ≤ 59, then fail.</li>
+
+ <li>If <var title="">sign</var> is "negative", then negate <var
+ title="">timezone<sub title="">minutes</sub></var>.</li>
+
+ </ol>
+
+ <p>Otherwise, fail.</p>
+
</li>
+ <li><p>Return <var title="">timezone<sub title="">hours</sub></var>
+ and <var title="">timezone<sub
+ title="">minutes</sub></var>.</p></li>
+
</ol>
- <p class="note">This format allows for time-zone offsets from -23:59
- to +23:59. In practice, however, the range of offsets of actual time
- zones is -12:00 to +14:00, and the minutes component of offsets of
- actual time zones is always either 00, 30, or 45.</p>
+ </div>
+
+ <h5>Global dates and times</h5>
+
+ <p>A <dfn title="concept-datetime">global date and time</dfn>
+ consists of a specific proleptic Gregorian date, consisting of a
+ year, a month, and a day, and a time, consisting of an hour, a
+ minute, a second, and a fraction of a second, expressed with a
+ time-zone offset, consisting of a signed number of hours and
+ minutes. <a href="#refsGREGORIAN">[GREGORIAN]</a></p>
+
+ <p>A string is a <dfn>valid global date and time string</dfn>
+ representing a date, time, and a time-zone offset if it consists of
+ the following components in the given order:</p>
+
+ <ol>
+
+ <li>A <span>valid date string</span> representing the date</li>
+
+ <li>A U+0054 LATIN CAPITAL LETTER T character (T)</li>
+
+ <li>A <span>valid time string</span> representing the time</li>
+
+ <li>A <span>valid time-zone offset string</span> representing the time-zone offset</li>
+
+ </ol>
+
<p>Times in dates before the formation of UTC in the mid twentieth
century must be expressed and interpreted in terms of UT1
(contemporary Earth solar time at the 0° longitude), not UTC
@@ -5428,95 +5677,6 @@
</ol>
- <p>The rules to <dfn>parse a time-zone offset component</dfn>, given
- an <var title="">input</var> string and a <var
- title="">position</var>, are as follows. This will return either
- time-zone hours and time-zone minutes, or nothing. If at any point
- the algorithm says that it "fails", this means that it is aborted at
- that point and returns nothing.</p>
-
- <ol>
-
- <li>
-
- <p>If the character at <var title="">position</var> is a U+005A
- LATIN CAPITAL LETTER Z character (Z), then:</p>
-
- <ol>
-
- <li><p>Let <var title="">timezone<sub title="">hours</sub></var>
- be 0.</p></li>
-
- <li><p>Let <var title="">timezone<sub
- title="">minutes</sub></var> be 0.</p></li>
-
- <li><p>Advance <var title="">position</var> to the next character
- in <var title="">input</var>.</p></li>
-
- </ol>
-
- <p>Otherwise, if the character at <var title="">position</var> is
- either a U+002B PLUS SIGN (+) or a U+002D HYPHEN-MINUS (-),
- then:</p>
-
- <ol>
-
- <li><p>If the character at <var title="">position</var> is a
- U+002B PLUS SIGN (+), let <var title="">sign</var> be
- "positive". Otherwise, it's a U+002D HYPHEN-MINUS (-); let <var
- title="">sign</var> be "negative".</p></li>
-
- <li><p>Advance <var title="">position</var> to the next character
- in <var title="">input</var>.</p></li>
-
- <li><p><span>Collect a sequence of characters</span> in the range
- U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
- sequence is not exactly two characters long, then
- fail. Otherwise, interpret the resulting sequence as a base-ten
- integer. Let that number be the <var title="">timezone<sub
- title="">hours</sub></var>.</p></li>
-
- <li>If <var title="">timezone<sub title="">hours</sub></var> is
- not a number in the range 0 ≤ <var
- title="">timezone<sub
- title="">hours</sub></var> ≤ 23, then fail.</li>
-
- <li>If <var title="">sign</var> is "negative", then negate <var
- title="">timezone<sub title="">hours</sub></var>.</li>
-
- <li><p>If <var title="">position</var> is beyond the end of <var
- title="">input</var> or if the character at <var
- title="">position</var> is not a U+003A COLON character, then
- fail. Otherwise, move <var title="">position</var> forwards one
- character.</p></li>
-
- <li><p><span>Collect a sequence of characters</span> in the range
- U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
- sequence is not exactly two characters long, then
- fail. Otherwise, interpret the resulting sequence as a base-ten
- integer. Let that number be the <var title="">timezone<sub
- title="">minutes</sub></var>.</p></li>
-
- <li>If <var title="">timezone<sub title="">minutes</sub></var> is
- not a number in the range 0 ≤ <var
- title="">timezone<sub
- title="">minutes</sub></var> ≤ 59, then fail.</li>
-
- <li>If <var title="">sign</var> is "negative", then negate <var
- title="">timezone<sub title="">minutes</sub></var>.</li>
-
- </ol>
-
- <p>Otherwise, fail.</p>
-
- </li>
-
- <li><p>Return <var title="">timezone<sub title="">hours</sub></var>
- and <var title="">timezone<sub
- title="">minutes</sub></var>.</p></li>
-
- </ol>
-
</div>
@@ -5637,28 +5797,487 @@
</div>
- <h5>Vaguer moments in time</h5>
+ <h5>Durations</h5>
- <p>A string is a <dfn>valid date or time string</dfn> if it is also
- one of the following:</p>
+ <p>A <dfn title="concept-duration">duration</dfn> consists of
+ <!--MONTHS: either a number of months or--> a number of seconds.</p>
+ <p class="note">Since months and seconds are not comparable (a month
+ is not a precise number of seconds, but is instead a period whose
+ exact length depends on the precise day from which it is measured) a
+ <span title="concept-duration">duration</span> as defined in this
+ specification cannot <!--MONTHS: consist of a mixture of both-->
+ include months (or years, which are equivalent to twelve months).
+ Only durations that describe a specific number of seconds can be
+ described.</p>
+
+ <p>A string is a <dfn>valid duration string</dfn> representing a
+ <span title="concept-duration">duration</span> <var title="">t</var>
+ if it consists of either of the following:</p>
+
<ul>
- <li>A <span>valid date string</span>.</li>
+ <li>
- <li>A <span>valid time string</span>.</li>
+ <!-- The ISO format -->
- <li>A <span>valid global date and time string</span>.</li>
+ <!-- NOTE: ISO durations also have a number of formats we do not
+ consider conforming:
+ - a "week" format (e.g. P4W). This one is actually supported
+ by the parser.
+
+ - P<date>T<time>, with or without hyphens
+
+ - All these formats, with commas instead of periods for the
+ seconds decimal
+
+ -->
+
+ <p>A literal U+0050 LATIN CAPITAL LETTER P character followed by
+ one or more of the following subcomponents, in the order given,
+ where <!--the number of years, if any, multiplied by twelve, plus
+ the number of months, if any, equals the number of months in <var
+ title="">t</var>, if the duration is in months; or, if it is in
+ seconds, -->the number of days, hours, minutes, and seconds
+ corresponds to the same number of seconds as in <var
+ title="">t</var>:</p>
+
+ <ol>
+<!--MONTHS:
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a U+0059
+ LATIN CAPITAL LETTER Y character, representing a number of
+ years.</p></li>
+
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a U+004D
+ LATIN CAPITAL LETTER M character, representing a number of
+ months.</p></li>
+-->
+
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a U+0044
+ LATIN CAPITAL LETTER D character, representing a number of
+ days.</p></li>
+
+ <li>
+
+ <p>A U+0054 LATIN CAPITAL LETTER T character followed by one or
+ more of the following subcomponents, in the order given:</p>
+
+ <ol>
+
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a
+ U+0048 LATIN CAPITAL LETTER H character, representing a number
+ of hours.</p></li>
+
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span> followed by a
+ U+004D LATIN CAPITAL LETTER M character, representing a number
+ of minutes.</p></li>
+
+ <li>
+
+ <p>The following components:</p>
+
+ <ol>
+
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span>, representing a
+ number of seconds.</p></li>
+
+ <li><p>Optionally, a U+002E FULL STOP character (.) followed
+ by one or more <span
+ title="concept-datetime-digit">digits</span>, representing a
+ fraction of a second.</p></li>
+
+ <li><p>A U+0053 LATIN CAPITAL LETTER S character.</p></li>
+
+ </ol>
+
+ </li>
+
+ </ol>
+
+ </li>
+
+ </ol>
+
+ <p class="note">This, as with a number of other date- and
+ time-related microsyntaxes defined in this specification, is based
+ on one of the formats defined in ISO 8601. <a
+ href="#refsISO8601">[ISO8601]</a></p>
+
+ </li>
+
+ <li>
+
+ <p>One or more <span title="duration time component">duration time
+ components</span>, each with a different <span>duration time
+ component scale</span>, in any order; the sum of the represented
+ seconds being equal to the number of seconds in <var
+ title="">t</var>.</p>
+
+ <p>A <dfn>duration time component</dfn> is a string consisting of
+ the following components:</p>
+
+ <ol>
+
+ <li><p>Zero or more <span title="space character">space
+ characters</span>.</p></li>
+
+ <li><p>One or more <span
+ title="concept-datetime-digit">digits</span>, representing a
+ number of time units, scaled by the <span>duration time component
+ scale</span> specified (see below) to represent a number of
+ seconds.</p></li>
+
+ <li><p>If the <span>duration time component scale</span>
+ specified is 1 (i.e. the units are seconds), then, optionally, a
+ U+002E FULL STOP character (.) followed by one or more <span
+ title="concept-datetime-digit">digits</span>, representing a
+ fraction of a second.</p></li>
+
+ <li><p>Zero or more <span title="space character">space
+ characters</span>.</p></li>
+
+ <li>
+
+ <p>One of the following characters, representing the
+ <dfn>duration time component scale</dfn> of the time unit used
+ in the numeric part of the <span>duration time
+ component</span>:</p>
+
+ <dl>
+
+ <dt>U+0057 LATIN CAPITAL LETTER W character</dt>
+ <dt>U+0077 LATIN SMALL LETTER W character</dt>
+
+ <dd>Weeks. The scale is 604800.</dd>
+
+ <dt>U+0044 LATIN CAPITAL LETTER D character</dt>
+ <dt>U+0064 LATIN SMALL LETTER D character</dt>
+
+ <dd>Days. The scale is 86400.</dd>
+
+ <dt>U+0048 LATIN CAPITAL LETTER H character</dt>
+ <dt>U+0068 LATIN SMALL LETTER H character</dt>
+
+ <dd>Hours. The scale is 3600.</dd>
+
+ <dt>U+004D LATIN CAPITAL LETTER M character</dt>
+ <dt>U+006D LATIN SMALL LETTER M character</dt>
+
+ <dd>Minutes. The scale is 60.</dd>
+
+ <dt>U+0053 LATIN CAPITAL LETTER S character</dt>
+ <dt>U+0073 LATIN SMALL LETTER S character</dt>
+
+ <dd>Seconds. The scale is 1.</dd>
+
+ </dl>
+
+ </li>
+
+ <li><p>Zero or more <span title="space character">space
+ characters</span>.</p></li>
+
+ </ol>
+
+ <p class="note">This is not based on any of the formats in ISO
+ 8601. It is intended to be a more human-readable alternative to
+ the ISO 8601 duration format.</p>
+
+ </li>
+
</ul>
- <p>A string is a <dfn>valid date or time string in content</dfn> if
- it consists of zero or more <span>White_Space</span> characters,
- followed by a <span>valid date or time string</span>, followed by
- zero or more further <span>White_Space</span> characters.</p>
+ <div class="impl">
- <hr>
+ <p>The rules to <dfn>parse a duration string</dfn> are as follows.
+ This will return either a <span
+ title="concept-duration">duration</span> or nothing. If at any point
+ the algorithm says that it "fails", this means that it is aborted at
+ that point and returns nothing.</p>
+ <ol>
+
+ <!--MONTHS: this algorithm actually already parses months
+ adequately, though it would need tweaking if we introduced a "mo"
+ unit for the non-ISO variant. See other "MONTHS" annotations below. -->
+
+ <li><p>Let <var title="">input</var> be the string being
+ parsed.</p></li>
+
+ <li><p>Let <var title="">position</var> be a pointer into <var
+ title="">input</var>, initially pointing at the start of the
+ string.</p></li>
+
+ <li><p>Let <var title="">months</var>, <var title="">seconds</var>,
+ and <var title="">component count</var> all be zero.</p></li>
+
+ <li>
+
+ <p>Let <var title="">M-disambiguator</var> be <i>minutes</i>.</p>
+
+ <!--MONTHS: this note would change-->
+ <p class="note">This flag's othe value is <i>months</i>. It is
+ used to disambiguate the "M" unit in ISO8601 durations, which use
+ the same unit for months and minutes. Months are not allowed, but
+ are parsed for future compatibility and to avoid misinterpreting
+ ISO8601 durations that would be valid in other contexts.</p>
+
+ </li>
+
+ <li><p><span>Skip whitespace</span>.</p></li>
+
+ <li><p>If <var title="">position</var> is past the end of <var
+ title="">input</var>, then fail.</p></li>
+
+ <li><p>If the character in <var title="">input</var> pointed to by
+ <var title="">position</var> is a U+0050 LATIN CAPITAL LETTER P
+ character, then advance <var title="">position</var> to the next
+ character, set <var title="">M-disambiguator</var> to
+ <i>months</i>, and <span>skip whitespace</span>.</p></li>
+
+ <li>
+
+ <p>Run the following substeps in a loop, until the first step in
+ the loop requires that the loop be broken, or until a step
+ requiring the algorithm to fail is reached:</p>
+
+ <ol>
+
+ <li><p>Let <var title="">units</var> be undefined. It will be
+ assigned one of the following values: <i>years</i>,
+ <i>months</i>, <i>weeks</i>, <i>days</i>, <i>hours</i>,
+ <i>minutes</i>, and <i>seconds</i>.</p></li>
+
+ <li><p>Let <var title="">next character</var> be undefined. It is
+ used to process characters from the <var
+ title="">input</var>.</p></li>
+
+ <li><p>If <var title="">position</var> is past the end of <var
+ title="">input</var>, then break the loop.</p></li>
+
+ <li><p>If the character in <var title="">input</var> pointed to
+ by <var title="">position</var> is a U+0054 LATIN CAPITAL LETTER
+ T character, then advance <var title="">position</var> to the
+ next character, set <var title="">M-disambiguator</var> to
+ <i>minutes</i>, <span>skip whitespace</span>, and return to the
+ top of the loop.</p></li>
+
+ <li><p>Set <var title="">next character</var> to the character in
+ <var title="">input</var> pointed to by <var
+ title="">position</var>.</p></li>
+
+ <li>
+
+ <p>If <var title="">next character</var> is a U+002E FULL STOP
+ character (.), then let <var title="">N</var> equal zero. (Do
+ not advance <var title="">position</var>. That is taken care of
+ below.)</p>
+
+ <p>Otherwise, if <var title="">next character</var> is a
+ character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
+ NINE (9), then <span>collect a sequence of characters</span> in
+ the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
+ interpret the resulting sequence as a base-ten integer, and let
+ <var title="">N</var> be that number.</p>
+
+ <p>Otherwise <var title="">next character</var> is not part of a
+ number; fail.</p>
+
+ </li>
+
+ <li><p>If <var title="">position</var> is past the end of <var
+ title="">input</var>, then fail.</p></li>
+
+ <li><p>Set <var title="">next character</var> to the character in
+ <var title="">input</var> pointed to by <var
+ title="">position</var>, and this time advance <var
+ title="">position</var> to the next character. (If <var
+ title="">next character</var> was a U+002E FULL STOP character
+ (.) before, it will still be that character this time.)</p></li>
+
+ <li>
+
+ <p>If <var title="">next character</var> is a U+002E FULL STOP
+ character (.), then run these substeps:</p>
+
+ <ol>
+
+ <li><p><span>Collect a sequence of characters</span> in the
+ range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). Let <var
+ title="">s</var> be the resulting sequence.</p></li>
+
+ <li><p>If <var title="">s</var> is the empty string, then
+ fail.</p></li>
+
+ <li><p>Let <var title="">length</var> be the number of
+ characters in <var title="">s</var>.</p></li>
+
+ <li><p>Let <var title="">fraction</var> be the result of
+ interpreting <var title="">s</var> as a base-ten integer, and
+ then dividing that number by <span title="">10<sup
+ title=""><var title="">length</var></sup></span>.</li>
+
+ <li><p>Increment <var title="">N</var> by <var
+ title="">fraction</var>.</p></li>
+
+ <li><p><span>Skip whitespace</span>.</p></li>
+
+ <li><p>If <var title="">position</var> is past the end of <var
+ title="">input</var>, then fail.</p></li>
+
+ <li><p>Set <var title="">next character</var> to the character
+ in <var title="">input</var> pointed to by <var
+ title="">position</var>, and advance <var
+ title="">position</var> to the next character.</p></li>
+
+ <li><p>If <var title="">next character</var> is neither a
+ U+0053 LATIN CAPITAL LETTER S character nor a U+0073 LATIN
+ SMALL LETTER S character, then fail.</p></li>
+
+ <li><p>Set <var title="">units</var> to <i>seconds</i>.</p></li>
+
+ </ol>
+
+ <p>Otherwise, run these substeps:</p>
+
+ <ol>
+
+ <li><p>If <var title="">next character</var> is a <span>space
+ character</span>, then <span>skip whitespace</span>, set <var
+ title="">next character</var> to the character in <var
+ title="">input</var> pointed to by <var
+ title="">position</var>, and advance <var
+ title="">position</var> to the next character.</p></li>
+
+ <li>
+
+ <!--MONTHS: this would probably be where we would add more
+ logic to support a new unit like 'mo' -->
+
+ <p>If <var title="">next character</var> is a U+0059 LATIN
+ CAPITAL LETTER Y character, or a U+0079 LATIN SMALL LETTER Y
+ character, set <var title="">units</var> to <i>years</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>months</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+004D LATIN
+ CAPITAL LETTER M character or a U+006D LATIN SMALL LETTER M
+ character, and <var title="">M-disambiguator</var> is
+ <i>months</i>, then set <var title="">units</var> to
+ <i>months</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0057 LATIN
+ CAPITAL LETTER W character or a U+0077 LATIN SMALL LETTER W
+ character, set <var title="">units</var> to <i>weeks</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0044 LATIN
+ CAPITAL LETTER D character or a U+0064 LATIN SMALL LETTER D
+ character, set <var title="">units</var> to <i>days</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0048 LATIN
+ CAPITAL LETTER H character or a U+0068 LATIN SMALL LETTER H
+ character, set <var title="">units</var> to <i>hours</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+004D LATIN
+ CAPITAL LETTER M character or a U+006D LATIN SMALL LETTER M
+ character, and <var title="">M-disambiguator</var> is
+ <i>minutes</i>, then set <var title="">units</var> to
+ <i>minutes</i>.</p>
+
+ <p>If <var title="">next character</var> is a U+0053 LATIN
+ CAPITAL LETTER S character or a U+0073 LATIN SMALL LETTER S
+ character, set <var title="">units</var> to <i>seconds</i> and
+ set <var title="">M-disambiguator</var> to
+ <i>minutes</i>.</p>
+
+ <p>Otherwise if <var title="">next character</var> is none of
+ the above characters, then fail.</p>
+
+ </li>
+
+ </ol>
+
+ </li>
+
+ <li><p>Increment <var title="">component count</var>.</p></li>
+
+ <li><p>Let <var title="">multiplier</var> be 1.</p></li>
+
+ <li><p>If <var title="">units</var> is <i>years</i>, multiply
+ <var title="">multiplier</var> by 12 and set <var
+ title="">units</var> to <i>months</i>.</p></li>
+
+ <li>
+
+ <p>If <var title="">units</var> is <i>months</i>, add the
+ product of <var title="">N</var> and <var
+ title="">multiplier</var> to <var
+ title="">months</var>.</p>
+
+ <p>Otherwise, run these substeps:</p>
+
+ <ol>
+
+ <li><p>If <var title="">units</var> is <i>weeks</i>, multiply
+ <var title="">multiplier</var> by 7 and set <var
+ title="">units</var> to <i>days</i>.</p></li>
+
+ <li><p>If <var title="">units</var> is <i>days</i>, multiply
+ <var title="">multiplier</var> by 24 and set <var
+ title="">units</var> to <i>hours</i>.</p></li>
+
+ <li><p>If <var title="">units</var> is <i>hours</i>, multiply
+ <var title="">multiplier</var> by 60 and set <var
+ title="">units</var> to <i>minutes</i>.</p></li>
+
+ <li><p>If <var title="">units</var> is <i>minutes</i>, multiply
+ <var title="">multiplier</var> by 60 and set <var
+ title="">units</var> to <i>seconds</i>.</p></li>
+
+ <li><p>Forcibly, <var title="">units</var> is now
+ <i>seconds</i>. Add the product of <var title="">N</var> and
+ <var title="">multiplier</var> to <var
+ title="">seconds</var>.</p></li>
+
+ </ol>
+
+ </li>
+
+ <li><p><span>Skip whitespace</span>.</p></li>
+
+ </ol>
+
+ </li>
+
+ <li><p>If <var title="">component count</var> is zero,
+ fail.</p></li>
+
+ <!--MONTHS: if we add month support this is where you'd return them-->
+ <li><p>If <var title="">months</var> is not zero, fail.</p></li>
+
+ <li><p>Return the <span title="concept-duration">duration</span>
+ consisting of <var title="">seconds</var> seconds.</p></li>
+
+ </ol>
+
+ </div>
+
+
+ <h5>Vaguer moments in time</h5>
+
<p>A string is a <dfn>valid date string with optional time</dfn> if
it is also one of the following:</p>
@@ -5670,20 +6289,12 @@
</ul>
- <p>A string is a <dfn>valid date string in content with optional
- time</dfn> if it consists of zero or more <span>White_Space</span>
- characters, followed by a <span>valid date string with optional
- time</span>, followed by zero or more further
- <span>White_Space</span> characters.</p>
-
<div class="impl">
<hr>
<p>The rules to <dfn>parse a date or time string</dfn> are as
- follows. The algorithm is invoked with a flag indicating if the
- <i>in attribute</i> variant or the <i>in content</i> variant is to
- be used. The algorithm will return either a <span
+ follows. The algorithm will return either a <span
title="concept-date">date</span>, a <span
title="concept-time">time</span>, a <span
title="concept-datetime">global date and time</span>, or nothing. If
@@ -5699,9 +6310,6 @@
title="">input</var>, initially pointing at the start of the
string.</p></li>
- <li><p>For the <i>in content</i> variant: <span>skip White_Space
- characters</span>.</p></li>
-
<li><p>Set <var title="">start position</var> to the same position
as <var title="">position</var>.</p></li>
@@ -5752,9 +6360,6 @@
title="">timezone<sub title="">minutes</sub></var>. If this returns
nothing, then fail.</p>
- <li><p>For the <i>in content</i> variant: <span>skip White_Space
- characters</span>.</p></li>
-
<li><p>If <var title="">position</var> is <em>not</em> beyond the
end of <var title="">input</var>, then fail.</p></li>
@@ -7632,7 +8237,7 @@
characters that immediately follow the word "<code
title="">charset</code>" (there might not be any).</p></li>
- <li><p>If the next character is not a U+003D EQUALS SIGN ('='),
+ <li><p>If the next character is not a U+003D EQUALS SIGN (=),
then move <var title="">position</var> to point just before that
next character, and jump back to the step labeled
<i>loop</i>.</p></li>
@@ -7647,12 +8252,12 @@
<dl class="switch">
- <dt>If it is a U+0022 QUOTATION MARK ('"') and there is a later U+0022 QUOTATION MARK ('"') in <var title="">s</var></dt>
- <dt>If it is a U+0027 APOSTROPHE ("'") and there is a later U+0027 APOSTROPHE ("'") in <var title="">s</var></dt>
+ <dt>If it is a U+0022 QUOTATION MARK (") and there is a later U+0022 QUOTATION MARK (") in <var title="">s</var></dt>
+ <dt>If it is a U+0027 APOSTROPHE (') and there is a later U+0027 APOSTROPHE (') in <var title="">s</var></dt>
<dd>Return the encoding corresponding to the string between this character and the next earliest occurrence of this character.</dd>
- <dt>If it is an unmatched U+0022 QUOTATION MARK ('"')</dt>
- <dt>If it is an unmatched U+0027 APOSTROPHE ("'")</dt>
+ <dt>If it is an unmatched U+0022 QUOTATION MARK (")</dt>
+ <dt>If it is an unmatched U+0027 APOSTROPHE (')</dt>
<dt>If there is no next character</dt>
<dd>Return nothing.</dd>
@@ -11928,6 +12533,7 @@
<li><code>svg</code></li>
<li><code>table</code></li>
<li><code>textarea</code></li>
+ <li><code>time</code></li>
<li><code>u</code></li>
<li><code>ul</code></li>
<li><code>var</code></li>
@@ -12042,6 +12648,7 @@
<li><code>sup</code></li>
<li><code>svg</code></li>
<li><code>textarea</code></li>
+ <li><code>time</code></li>
<li><code>u</code></li>
<li><code>var</code></li>
<li><code>video</code></li>
@@ -12374,6 +12981,7 @@
<li><code>svg</code></li>
<li><code>table</code></li>
<li><code>textarea</code></li>
+ <li><code>time</code></li>
<li><code>u</code></li>
<li><code>ul</code> (if the element's children include at least one <code>li</code> element)</li>
<li><code>var</code></li>
@@ -15416,9 +16024,9 @@
page.</p></li>
<li><p>If the character in <var title="">input</var> pointed to
- by <var title="">position</var> is a U+003B SEMICOLON ("<code
- title="">;</code>"), then advance <var title="">position</var> to
- the next character. Otherwise, jump to the last step.</p></li>
+ by <var title="">position</var> is a U+003B SEMICOLON (;), then
+ advance <var title="">position</var> to the next character.
+ Otherwise, jump to the last step.</p></li>
<li><p><span>Skip whitespace</span>.</p></li>
@@ -15443,9 +16051,9 @@
<li><p><span>Skip whitespace</span>.</p></li>
<li><p>If the character in <var title="">input</var> pointed to
- by <var title="">position</var> is a U+003D EQUALS SIGN ("<code
- title="">=</code>"), then advance <var title="">position</var> to
- the next character. Otherwise, jump to the last step.</p></li>
+ by <var title="">position</var> is a U+003D EQUALS SIGN (=), then
+ advance <var title="">position</var> to the next character.
+ Otherwise, jump to the last step.</p></li>
<li><p><span>Skip whitespace</span>.</p></li>
@@ -18147,7 +18755,7 @@
<em>...more content...</em>
</div>
<footer>
- <p>Posted <data itemprop="datePublished" value="2009-10-10">Thursday</data>.</p>
+ <p>Posted <time itemprop="datePublished" datetime="2009-10-10">Thursday</time>.</p>
</footer>
</article>
<em>...more blog posts...</em>
@@ -18302,7 +18910,7 @@
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 itemprop="headline">The Very First Rule of Life</h1>
- <p><data itemprop="datePublished" value="2009-10-09">3 days ago</data></p>
+ <p><time itemprop="datePublished" datetime="2009-10-09">3 days ago</time></p>
<link itemprop="url" href="?comments=0">
</header>[
<p>If there's a microphone anywhere near you, assume it's hot and
@@ -18318,7 +18926,7 @@
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 itemprop="headline">The Very First Rule of Life</h1>
- <p><data itemprop="datePublished" value="2009-10-09">3 days ago</data></p>
+ <p><time itemprop="datePublished" datetime="2009-10-09">3 days ago</time></p>
<link itemprop="url" href="?comments=0">
</header>
<p>If there's a microphone anywhere near you, assume it's hot and
@@ -18332,7 +18940,7 @@
<p>Posted by: <span itemprop="creator" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">George Washington</span>
</span></p>
- <p><data itemprop="commentTime" value="2009-10-10">15 minutes ago</data></p>
+ <p><time itemprop="commentTime" datetime="2009-10-10">15 minutes ago</time></p>
</footer>
<p>Yeah! Especially when talking about your lobbyist friends!</p>
</article>
@@ -18342,7 +18950,7 @@
<p>Posted by: <span itemprop="creator" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">George Hammond</span>
</span></p>
- <p><data itemprop="commentTime" value="2009-10-10">5 minutes ago</data></p>
+ <p><time itemprop="commentTime" datetime="2009-10-10">5 minutes ago</time></p>
</footer>
<p>Hey, you have the same first name as me.</p>
</article>
@@ -18839,7 +19447,7 @@
<P><A HREF="/fm/015.ogv">Download video</A>.</P>
</VIDEO>
<FOOTER> <!-- footer for article -->
- <P>Published <DATA VALUE="2009-10-21T18:26-07:00">on 2009/10/21 at 6:26pm</DATA></P>
+ <P>Published <TIME DATETIME="2009-10-21T18:26-07:00">on 2009/10/21 at 6:26pm</TIME></P>
</FOOTER>
</ARTICLE>
<ARTICLE>
@@ -18848,7 +19456,7 @@
<P>It is fun to see them pull some coal cars because they look so
dwarfed in comparison.</P>
<FOOTER> <!-- footer for article -->
- <P>Published <DATA VALUE="2009-09-15T14:54-07:00">on 2009/09/15 at 2:54pm</DATA></P>
+ <P>Published <TIME DATETIME="2009-09-15T14:54-07:00">on 2009/09/15 at 2:54pm</TIME></P>
</FOOTER>
</ARTICLE>
<FOOTER> <!-- site wide footer -->
@@ -21901,6 +22509,9 @@
attribute must be present. Its value must be a representation of the
element's contents in a machine-readable format.</p>
+ <p class="note">When the value is date- or time-related, the more
+ specific <code>time</code> element can be used instead.</p>
+
<p>The element can be used for several purposes.</p>
<p>When combined with microformats or the <a
@@ -21929,16 +22540,273 @@
<div class="example">
- <p>The <code>data</code> element can be used to encode dates, for
+ <p>Here, a short table has its numeric values encoded using
+ <code>data</code> so that a script can provide a sorting mechanism
+ on each column, despite the numbers being presented in textual
+ form in one column and in a decomposed form in another.</p>
+
+ <pre><table class="sortable"> <!-- class used by script to find tables to which to add sorting controls -->
+ <thead> <tr> <th> Game <th> Corporations <th> Map Size
+ <tbody>
+ <tr> <td> 1830 <td> <data value="8">Eight</data> <td> <data value="93">19+74 hexes (93 total)</data>
+ <tr> <td> 1856 <td> <data value="11">Eleven</data> <td> <data value="99">12+87 hexes (99 total)</data>
+ <tr> <td> 1870 <td> <data value="10">Ten</data> <td> <data value="149">4+145 hexes (149 total)</data>
+</table></pre>
+
+ </div>
+
+
+
+
+ <h4>The <dfn><code>time</code></dfn> element</h4>
+
+ <dl class="element">
+ <dt>Categories</dt>
+ <dd><span>Flow content</span>.</dd>
+ <dd><span>Phrasing content</span>.</dd>
+ <dd><span>Palpable content</span>.</dd>
+ <dt>Contexts in which this element can be used:</dt>
+ <dd>Where <span>phrasing content</span> is expected.</dd>
+ <dt>Content model:</dt>
+ <dd><span>Phrasing content</span>.</dd>
+ <dt>Content attributes:</dt>
+ <dd><span>Global attributes</span></dd>
+ <dd><code title="attr-time-datetime">datetime</code></dd>
+ <dt>DOM interface:</dt>
+ <dd>
+<pre class="idl">interface <dfn>HTMLTimeElement</dfn> : <span>HTMLElement</span> {
+ attribute DOMString <span title="dom-time-datetime">datetime</span>;
+};</pre>
+ </dd>
+ </dl>
+
+ <p>The <code>time</code> element <span>represents</span> its
+ contents, along with a machine-readable form of those contents in
+ the <code title="attr-time-datetime">datetime</code> attribute. The
+ kind of content is limited to various kinds of dates, times,
+ time-zone offsets, and durations, as described below.</p>
+
+ <p>The <dfn title="attr-time-datetime"><code>datetime</code></dfn>
+ attribute may be present. If present, its value must be a
+ representation of the element's contents in a machine-readable
+ format.</p>
+
+ <p>A <code>time</code> element that does not have a <code
+ title="attr-time-datetime">datetime</code> content attribute must
+ not have any element descendants.</p>
+
+ <p>The <dfn>datetime value</dfn> of a <code>time</code> element is
+ the value of the element's <code
+ title="attr-time-datetime">datetime</code> content attribute, if
+ it has one, or the element's <code>textContent</code>, if it does
+ not.</p>
+
+ <p>The <span>datetime value</span> of a <code>time</code> element
+ must match one of the following syntaxes.</p>
+
+ <dl>
+
+ <dt>A <span>valid month string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>2011-11</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid date string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>2011-11-12</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid yearless date string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>11-12</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid time string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>14:54</time></pre>
+ <pre class="example"><time>14:54:39</time></pre>
+ <pre class="example"><time>14:54:39.92922</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid local date and time string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>2011-11-12T14:54</time></pre>
+ <pre class="example"><time>2011-11-12T14:54:39</time></pre>
+ <pre class="example"><time>2011-11-12T14:54:39.92922</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid time-zone offset string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>Z</time></pre>
+ <pre class="example"><time>+00:00</time></pre>
+ <pre class="example"><time>-08:00</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid global date and time string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>2011-11-12T14:54Z</time></pre>
+ <pre class="example"><time>2011-11-12T14:54:39Z</time></pre>
+ <pre class="example"><time>2011-11-12T14:54:39.92922Z</time></pre>
+ <pre class="example"><time>2011-11-12T14:54+00:00</time></pre>
+ <pre class="example"><time>2011-11-12T14:54:39+00:00</time></pre>
+ <pre class="example"><time>2011-11-12T14:54:39.92922+00:00</time></pre>
+ <pre class="example"><time>2011-11-12T06:54-08:00</time></pre>
+ <pre class="example"><time>2011-11-12T06:54:39-08:00</time></pre>
+ <pre class="example"><time>2011-11-12T06:54:39.92922-08:00</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid week string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>2011-W46</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid non-negative integer</span> representing a year</dt>
+
+ <dd>
+
+ <pre class="example"><time>2011</time></pre>
+
+ </dd>
+
+
+ <dt>A <span>valid duration string</span></dt>
+
+ <dd>
+
+ <pre class="example"><time>PT4H18M3S</time></pre>
+
+ <pre class="example"><time>4h 18m 3s</time></pre>
+
+ </dd>
+
+ </dl>
+
+ <div class="impl">
+
+ <p>The machine-readable equivalent of the element's contents must be
+ obtained from the element's <span>datetime value</span> by using the
+ following algorithm:</p>
+
+ <ol>
+
+ <li><p>If <span title="parse a month string">parsing a month
+ string</span> from the element's <span>datetime value</span>, if
+ The machine-readable equivalent is the <span
+ title="concept-month">month</span>, that is the machine-readable
+ equivalent; abort these steps.</p></li>
+
+ <li><p>If <span title="parse a date string">parsing a date
+ string</span> from the element's <span>datetime value</span>, if
+ The machine-readable equivalent is the <span
+ title="concept-date">date</span>, that is the machine-readable
+ equivalent; abort these steps.</p></li>
+
+ <li><p>If <span title="parse a yearless date string">parsing a
+ yearless date string</span> from the element's <span>datetime
+ value</span> returns a <span
+ title="concept-yearless-date">yearless date</span>, that is the
+ machine-readable equivalent; abort these steps.</p></li>
+
+ <li><p>If <span title="parse a time string">parsing a time
+ string</span> from the element's <span>datetime value</span>,
+ returns a <span title="concept-time">time</span>, that is the
+ machine-readable equivalent; abort these steps.</p></li>
+
+ <li><p>If <span title="parse a local date and time string">parsing
+ a local date and time string</span> from the element's
+ <span>datetime value</span> returns a <span
+ title="concept-datetime-local">local date and time</span>, that is
+ the machine-readable equivalent; abort these steps.</p></li>
+
+ <li><p>If <span title="parse a time-zone offset string">parsing a
+ time-zone offset string</span> from the element's <span>datetime
+ value</span>, returns a <span title="concept-timezone">time-zone
+ offset</span>, that is the machine-readable equivalent; abort
+ these steps.</p></li>
+
+ <li><p>If <span title="parse a global date and time
+ string">parsing a global date and time string</span> from the
+ element's <span>datetime value</span> returns a <span
+ title="concept-datetime">global date and time</span>, that is the
+ machine-readable equivalent; abort these steps.</p></li>
+
+ <li><p>If <span title="parse a week string">parsing a week
+ string</span> from the element's <span>datetime value</span>,
+ returns a <span title="concept-week">week</span>, that is the
+ machine-readable equivalent; abort these steps.</p></li>
+
+ <li><p>If the element's <span>datetime value</span> consists of
+ only characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
+ NINE (9), then the machine-readable equivalent is the base-ten
+ interpretation of those digits, representing a year; abort these
+ steps.</p></li>
+
+ <li><p>If <span title="parse a duration string">parsing a duration
+ string</span> from the element's <span>datetime value</span>,
+ returns a <span title="concept-duration">duration</span>, that is
+ the machine-readable equivalent; abort these steps.</p></li>
+
+ <li><p>There is no machine-readable equivalent.</p></li>
+
+ </ol>
+
+ <p class="note">The algorithms referenced above are intended to be
+ designed such that for any arbitrary string <var title="">s</var>,
+ only one of the algorithms returns a value. A more efficient
+ approach might be to create a single algorithm that parses all these
+ data types in one pass; developing such an algorithm is left as an
+ exercise to the reader.</p>
+
+ <p>The <dfn title="dom-time-datetime"><code>datetime</code></dfn>
+ IDL attribute must <span>reflect</span> the content attribute of the
+ same name.</p>
+
+ </div>
+
+ <div class="example">
+
+ <p>The <code>time</code> element can be used to encode dates, for
example in microformats. The following shows a hypothetical way of
encoding an event using a variant on hCalendar that uses the
- <code>data</code> element:</p>
+ <code>time</code> element:</p>
<pre><div class="vevent">
<a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
<span class="summary">Web 2.0 Conference</span>:
- <data class="dtstart" value="2007-10-05">October 5</data> -
- <data class="dtend" value="2007-10-20">19</data>,
+ <time class="dtstart" datetime="2007-10-05">October 5</time> -
+ <time class="dtend" datetime="2007-10-20">19</time>,
at the <span class="location">Argent Hotel, San Francisco, CA</span>
</div></pre>
@@ -21951,12 +22819,12 @@
<div class="example">
<p>In this example, an article's publication date is marked up
- using <code>data</code> and the schema.org microdata
+ using <code>time</code> and the schema.org microdata
vocabulary:</p>
<pre><article itemscope itemtype="http://schema.org/BlogPosting">
<h1 itemprop="headline">Small tasks</h1>
- <footer>Published <data itemprop="datePublished" value="2009-08-30">yesterday</data>.</footer>
+ <footer>Published <time itemprop="datePublished" datetime="2009-08-30">yesterday</time>.</footer>
<p itemprop="articleBody">I put a bike bell on his bike.</p>
</article></pre>
@@ -21964,43 +22832,46 @@
<div class="example">
- <p>In the following snippet, the <code>data</code> element is used
+ <p>In the following snippet, the <code>time</code> element is used
to encode a date in the ISO8601 format, for later processing by a
script:</p>
- <pre><p>Our first date was <data value="2006-09-23">a Saturday</data>.</p></pre>
+ <pre><p>Our first date was <time datetime="2006-09-23">a Saturday</time>.</p></pre>
<p>In this second snippet, the value includes a time:</p>
- <pre><p>We stopped talking at <data value="2006-09-24T05:00-07:00">5am the next morning</data>.</p></pre>
+ <pre><p>We stopped talking at <time datetime="2006-09-24T05:00-07:00">5am the next morning</time>.</p></pre>
<p>A script loaded by the page (and thus privy to the page's
internal convention of marking up dates and times using the
- <code>data</code> element) could scan through the page and look at
- all the <code>data</code> elements therein to create an index of
+ <code>time</code> element) could scan through the page and look at
+ all the <code>time</code> elements therein to create an index of
dates and times.</p>
</div>
<div class="example">
- <p>Here, a short table has its numeric values encoded using
- <code>data</code> so that a script can provide a sorting mechanism
- on each column, despite the numbers being presented in textual
- form in one column and in a decomposed form in another.</p>
+ <p>For example, this element conveys the string "Tuesday" with
+ the additional semantic that the 12th of November 2011 is the
+ meaning that corresponds to "Tuesday":</p>
- <pre><table class="sortable"> <!-- class used by script to find tables to which to add sorting controls -->
- <thead> <tr> <th> Game <th> Corporations <th> Map Size
- <tbody>
- <tr> <td> 1830 <td> <data value="8">Eight</data> <td> <data value="93">19+74 hexes (93 total)</data>
- <tr> <td> 1856 <td> <data value="11">Eleven</data> <td> <data value="99">12+87 hexes (99 total)</data>
- <tr> <td> 1870 <td> <data value="10">Ten</data> <td> <data value="149">4+145 hexes (149 total)</data>
-</table></pre>
+ <pre>Today is <time datetime="2011-11-12">Tuesday</time>.</pre>
</div>
+ <div class="example">
+ <p>In this example, a specific time in the Pacific Standard Time
+ timezone is specified:</p>
+ <pre>Your next meeting is at <time datetime="2011-11-12T15:00-08:00">3pm</time>.</pre>
+
+ </div>
+
+
+
+
<h4>The <dfn><code>code</code></dfn> element</h4>
<dl class="element">
@@ -23190,6 +24061,11 @@
<td><pre class="example">Available starting today! <strong><data value="UPC:022014640201">North Coast Organic Apple Cider</data></strong></pre>
<tr>
+ <td><code>time</code>
+ <td>Machine-readable equivalent of date- or time-related data
+ <td><pre class="example">Available starting on <strong><time datetime="2011-11-12">November 12th</time></strong>!</pre>
+
+ <tr>
<td><code>code</code>
<td>Computer code
<td><pre class="example">The <strong><code>fruitdb</code></strong> program can be used for tracking fruit production.</pre>
@@ -63882,7 +64758,15 @@
<p>The following extract shows how an IM conversation log could be
marked up, using the <code>data</code> element to provide Unix
- timestamps for each line.</p>
+ timestamps for each line. Note that the timestamps are provided in
+ a format that the <code>time</code> element does not support, so
+ the <code>data</code> element is used instead (namely, Unix <code
+ title="">time_t</code> timestamps). Had the author wished to mark
+ up the data using one of the date and time formats supported by the
+ <code>time</code> element, that element could have been used
+ instead of <code>data</code>. This could be advantageous as it
+ would allow data analysis tools to detect the timestamps
+ unambiguously, without coordination with the page author.</p>
<pre><p> <data value="1319898155">14:22</data> <b>egof</b> I'm not that nerdy, I've only seen 30% of the star trek episodes
<p> <data value="1319898192">14:23</data> <b>kaj</b> if you know what percentage of the star trek episodes you have seen, you are inarguably nerdy
@@ -64772,11 +65656,27 @@
<div class="example">
+ <p>Here, there is an item with a property whose value is a product
+ ID. The ID is not human-friendly, so the product's name is used
+ the human-visible text instead of the ID.</p>
+
+ <pre><h1 itemscope>
+ <data itemprop="product-id" value="9678AOU879">The Instigator 2000</data>
+</h1></pre>
+
+ </div>
+
+ <p>For date- and time-related data, the <code>time</code> element
+ and its <code title="attr-time-datetime">datetime</code> attribute
+ can be used instead.</p>
+
+ <div class="example">
+
<p>In this example, the item has one property, "birthday", whose
value is a date:</p>
<pre><div itemscope>
- I was born on <data itemprop="birthday" value="2009-05-10">May 10th 2009</data>.
+ I was born on <time itemprop="birthday" datetime="2009-05-10">May 10th 2009</time>.
</div></pre>
</div>
@@ -64995,7 +65895,7 @@
<dt>Author
<dd itemprop="author">Peter F. Hamilton
<dt>Publication date
- <dd><data itemprop="pubdate" value="1996-01-26">26 January 1996</data>
+ <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time>
</dl></pre>
<p>The "<code title="">http://vocab.example.net/book</code>"
@@ -65708,6 +66608,12 @@
the empty string otherwise.</p></dd>
+ <dt>If the element is a <code>time</code> element</dt>
+
+ <dd><p>The value is the element's <span>datetime
+ value</span>.</p></dd>
+
+
<dt>Otherwise</dt>
<dd><p>The value is the element's
@@ -66093,6 +66999,18 @@
title="attr-data-value">value</code> content attribute.</p></dd>
+ <dt>If the element is a <code>time</code> element</dt>
+
+ <dd><p>On getting, if the element has a <code
+ title="attr-time-datetime">datetime</code> content attribute, the
+ IDL attribute must return that content attribute's value;
+ otherwise, it must return the element's <code>textContent</code>.
+ On setting, the IDL attribute must act as it would if it was <span
+ title="reflect">reflecting</span> the element's <code
+ title="attr-time-datetime">datetime</code> content
+ attribute.</p></dd>
+
+
<dt>Otherwise</dt>
<dd><p>The attribute must act the same as the element's
@@ -69140,8 +70058,8 @@
...
<h1 itemprop="summary">Bluesday Tuesday: Money Road</h1>
...
- <data itemprop="dtstart" value="2009-05-05T19:00:00Z">May 5th @ 7pm</data>
- (until <data itemprop="dtend" value="2009-05-05T21:00:00Z">9pm</data>)
+ <time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th @ 7pm</time>
+ (until <time itemprop="dtend" datetime="2009-05-05T21:00:00Z">9pm</time>)
...
<a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
rel="bookmark" itemprop="url">Link to this page</a>
@@ -69202,8 +70120,8 @@
<pre><div itemscope itemtype="http://microformats.org/profile/hcalendar#vevent">
<p>I'm going to
<strong itemprop="summary">Bluesday Tuesday: Money Road</strong>,
- <data itemprop="dtstart" value="2009-05-05T19:00:00Z">May 5th at 7pm</data>
- to <data itemprop="dtend" value="2009-05-05T21:00:00Z">9pm</data>,
+ <time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th at 7pm</time>
+ to <time itemprop="dtend" datetime="2009-05-05T21:00:00Z">9pm</time>,
at <span itemprop="location">The RoadHouse</span>!</p>
<p><a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
itemprop="url">See this event on livebrum.co.uk</a>.</p>
@@ -111187,6 +112105,8 @@
<!--END dev-html--><p><i>This section is non-normative.</i></p><!--START dev-html-->
+ <!-- XXX this index doesn't list the palpable elements -->
+
<table>
<caption>List of elements</caption>
<thead>
@@ -112533,6 +113453,18 @@
</tr>
<tr>
+ <th><code>time</code></th>
+ <td>Machine-readable equivalent of date- or time-related data</td>
+ <td><span title="Flow content">flow</span>;
+ <span title="Phrasing content">phrasing</span></td>
+ <td><span title="Phrasing content">phrasing</span></td>
+ <td><span title="Phrasing content">phrasing</span></td>
+ <td><span title="global attributes">globals</span>;
+ <code title="attr-time-datetime">datetime</code></td>
+ <td><code>HTMLTimeElement</code></td>
+ </tr>
+
+ <tr>
<th><code>title</code></th>
<td>Document title</td>
<td><span title="Metadata content">metadata</span></td>
@@ -112760,6 +113692,7 @@
<code>svg</code>;
<code>table</code>;
<code>textarea</code>;
+ <code>time</code>;
<code>u</code>;
<code>ul</code>;
<code>var</code>;
@@ -112843,6 +113776,7 @@
<code>sup</code>;
<code>svg</code>;
<code>textarea</code>;
+ <code>time</code>;
<code>u</code>;
<code>var</code>;
<code>video</code>;
@@ -113040,6 +113974,7 @@
<code>svg</code>;
<code>table</code>;
<code>textarea</code>;
+ <code>time</code>;
<code>u</code>;
<code>var</code>;
<code>video</code>
@@ -113217,6 +114152,20 @@
<td> Date and (optionally) time of the change
<td> <span>Valid date string with optional time</span>
<tr>
+ <th> <code title="">datetime</code>
+ <td> <code title="attr-time-datetime">time</code>
+ <td> Machine-readable value
+ <td> <span>Valid month string</span>,
+ <span>valid date string</span>,
+ <span>valid yearless date string</span>,
+ <span>valid time string</span>,
+ <span>valid local date and time string</span>,
+ <span>valid time-zone offset string</span>,
+ <span>valid global date and time string</span>,
+ <span>valid week string</span>,
+ <span>valid non-negative integer</span>, or
+ <span>valid duration string</span>
+ <tr>
<th> <code title="">default</code>
<td> <code title="attr-track-default">track</code>
<td> Enable the track if no other <span>text track</span> is more suitable.
@@ -113820,12 +114769,6 @@
"<code title="attr-button-type-button">button</code>"
<tr>
<th> <code title="">type</code>
- <td> <code title="attr-button-type">button</code>;
- <code title="attr-input-type">input</code>
- <td> Type of form control
- <td> <span title="attr-input-type"><code>input</code> type keyword</span>
- <tr>
- <th> <code title="">type</code>
<td> <code title="attr-command-type">command</code>
<td> Type of command
<td> "<code title="attr-command-type-keyword-command">command</code>";
@@ -113842,6 +114785,11 @@
<td> <span>Valid MIME type</span>
<tr>
<th> <code title="">type</code>
+ <td> <code title="attr-input-type">input</code>
+ <td> Type of form control
+ <td> <span title="attr-input-type"><code>input</code> type keyword</span>
+ <tr>
+ <th> <code title="">type</code>
<td> <code title="attr-menu-type">menu</code>
<td> Type of menu
<td> "<code title="context menu state">context</code>"; "<code title="toolbar state">toolbar</code>"
@@ -113864,7 +114812,7 @@
<td> <a href="#attribute-text">Text</a>
<tr>
<th> <code title="">value</code>
- <td> <code title="attr-data-value">input</code>
+ <td> <code title="attr-data-value">data</code>
<td> Machine-readable value
<td> <a href="#attribute-text">Text</a>*
<tr>
@@ -114791,6 +115739,10 @@
<td> <code>HTMLTableSectionElement</code> : <code>HTMLElement</code>
<tr>
+ <td> <code>time</code>
+ <td> <code>HTMLTimeElement</code> : <code>HTMLElement</code>
+
+ <tr>
<td> <code>title</code>
<td> <code>HTMLTitleElement</code> : <code>HTMLElement</code>
More information about the Commit-Watchers
mailing list