[html5] r2381 - [] (0) Redefine datetimes to be stricter. Merge the two definitions of timezoned [...]
whatwg at whatwg.org
whatwg at whatwg.org
Wed Oct 29 17:21:52 PDT 2008
Author: ianh
Date: 2008-10-29 17:21:51 -0700 (Wed, 29 Oct 2008)
New Revision: 2381
Modified:
index
source
Log:
[] (0) Redefine datetimes to be stricter. Merge the two definitions of timezoned datetimes.
Modified: index
===================================================================
--- index 2008-10-29 22:30:17 UTC (rev 2380)
+++ index 2008-10-30 00:21:51 UTC (rev 2381)
@@ -16,7 +16,7 @@
<div class=head>
<p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<h1>HTML 5</h1>
- <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 29 October 2008</h2>
+ <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 30 October 2008</h2>
<p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<dl><dt>Multiple-page version:</dt>
@@ -225,15 +225,14 @@
<li><a href=#lists-of-integers><span class=secno>2.4.3.6 </span>Lists of integers</a></ol></li>
<li><a href=#dates-and-times><span class=secno>2.4.4 </span>Dates and times</a>
<ol>
- <li><a href=#specific-moments-in-time><span class=secno>2.4.4.1 </span>Specific moments in time</a></li>
- <li><a href=#utc-dates-and-times><span class=secno>2.4.4.2 </span>UTC dates and times</a></li>
- <li><a href=#local-dates-and-times><span class=secno>2.4.4.3 </span>Local dates and times</a></li>
- <li><a href=#dates><span class=secno>2.4.4.4 </span>Dates</a></li>
- <li><a href=#months><span class=secno>2.4.4.5 </span>Months</a></li>
- <li><a href=#weeks><span class=secno>2.4.4.6 </span>Weeks</a></li>
- <li><a href=#times><span class=secno>2.4.4.7 </span>Times</a></li>
- <li><a href=#vaguer-moments-in-time><span class=secno>2.4.4.8 </span>Vaguer moments in time</a></li>
- <li><a href=#time-offsets><span class=secno>2.4.4.9 </span>Time offsets</a></ol></li>
+ <li><a href=#global-dates-and-times><span class=secno>2.4.4.1 </span>Global dates and times</a></li>
+ <li><a href=#local-dates-and-times><span class=secno>2.4.4.2 </span>Local dates and times</a></li>
+ <li><a href=#dates><span class=secno>2.4.4.3 </span>Dates</a></li>
+ <li><a href=#months><span class=secno>2.4.4.4 </span>Months</a></li>
+ <li><a href=#weeks><span class=secno>2.4.4.5 </span>Weeks</a></li>
+ <li><a href=#times><span class=secno>2.4.4.6 </span>Times</a></li>
+ <li><a href=#vaguer-moments-in-time><span class=secno>2.4.4.7 </span>Vaguer moments in time</a></li>
+ <li><a href=#time-offsets><span class=secno>2.4.4.8 </span>Time offsets</a></ol></li>
<li><a href=#space-separated-tokens><span class=secno>2.4.5 </span>Space-separated tokens</a></li>
<li><a href=#comma-separated-tokens><span class=secno>2.4.6 </span>Comma-separated tokens</a></li>
<li><a href=#keywords-and-enumerated-attributes><span class=secno>2.4.7 </span>Keywords and enumerated attributes</a></li>
@@ -2686,51 +2685,119 @@
Gregorian calendar. <a href=#refsGREGORIAN>[GREGORIAN]</a></p>
- <h5 id=specific-moments-in-time><span class=secno>2.4.4.1 </span>Specific moments in time</h5>
+ <h5 id=global-dates-and-times><span class=secno>2.4.4.1 </span>Global dates and times</h5>
- <p class=XXX>This syntax is going to be tightened up and
- made almost exactly the same as the <a href=#valid-utc-date-and-time-string>valid UTC date and time
- string</a> syntax, with the exception of allowing time zones. In
- fact what we might do is allow time zones in general, use the same
- parser, etc, but require that UAs always use the UTC time zone when
- synthesizing datetimes for form submission.</p>
+ <p>A <dfn id=concept-datetime title=concept-datetime>global date and time</dfn>
+ consists of a specific Gregorian date, consisting of a year, a
+ month, a day, an hour, a minute, a second, and a fraction of a
+ second, expressed with a time zone, consisting of a number of hours
+ and minutes. <a href=#refsGREGORIAN>[GREGORIAN]</a></p>
- <p>A string is a <dfn id=valid-datetime>valid datetime</dfn> if it has four digits
- (representing the year), a literal hyphen, two digits (representing
- the month), a literal hyphen, two digits (representing the day),
- optionally some spaces, either a literal T or a space, optionally
- some more spaces, two digits (for the hour), a colon, two digits
- (the minutes), optionally the seconds (which, if included, must
- consist of another colon, two digits (the integer part of the
- seconds), and optionally a decimal point followed by one or more
- digits (for the fractional part of the seconds)), optionally some
- spaces, and finally either a literal Z (indicating the time zone is
- UTC), or, a plus sign or a minus sign followed by two digits, a
- colon, and two digits (for the sign, the hours and minutes of the
- timezone offset respectively); with the month-day combination being
- a valid date in the given year according to the Gregorian calendar,
- the hour values (<var title="">h</var>) being in the range
- 0 ≤ <var title="">h</var> ≤ 23, the minute
- values (<var title="">m</var>) in the range 0 ≤ <var title="">m</var> ≤ 59, and the second value (<var title="">s</var>) being in the range 0 ≤ <var title="">h</var> < 60. <a href=#refsGREGORIAN>[GREGORIAN]</a></p>
-
<!--XXX [GREGORIAN] should point to
<dd id="refsGREGORIAN">[GREGORIAN]</dd>
<dd>(Non-normative) <cite>Inter Gravissimas</cite>, A. Lilius, C. Clavius. Gregory XIII Papal Bulls, February 1582.</dd>
-->
- <p>The digits must be characters in the range U+0030 DIGIT ZERO (0)
- to U+0039 DIGIT NINE (9), the hyphens must be a U+002D HYPHEN-MINUS
- characters, the T must be a U+0054 LATIN CAPITAL LETTER T, the
- colons must be U+003A COLON characters, the decimal point must be a
- U+002E FULL STOP, the Z must be a U+005A LATIN CAPITAL LETTER Z, the
- plus sign must be a U+002B PLUS SIGN, and the minus U+002D (same as
- the hyphen).</p>
+ <p>A string is a <dfn id=valid-global-date-and-time-string>valid global date and time string</dfn> if it
+ has the components in the following list, in the given order, and if
+ the components in the list follow the constraints given after the
+ list:</p>
+ <ol><li>Four or more digits (representing the year)</li>
+
+ <li>A U+002D HYPHEN-MINUS character (-).</li>
+
+ <li>Two digits (representing the month)</li>
+
+ <li>A U+002D HYPHEN-MINUS character (-).</li>
+
+ <li>Two digits (representing the day)</li>
+
+ <li>A U+0054 LATIN CAPITAL LETTER T character.</li>
+
+ <li>Two digits (representing the hour)</li>
+
+ <li>A U+003A COLON character (:).</li>
+
+ <li>Two digits (representing the minutes)</li>
+
+ <li>Optionally:
+
+ <ol><li>A U+003A COLON character (:).</li>
+
+ <li>Two digits (representing the integer part of the seconds)</li>
+
+ <li>Optionally:
+
+ <ol><li>A 002E FULL STOP character (.)</li>
+
+ <li>One or more digits (representing the fractional part of the seconds)</li>
+
+ </ol></li>
+
+ </ol></li>
+
+ <li>Either:
+
+ <ul><li>A U+005A LATIN CAPITAL LETTER Z character (indicating the
+ time zone is UTC)</li>
+
+ <li>Or:
+
+ <ol><li>Either a U+002B PLUS SIGN character (+) or a U+002D
+ HYPHEN-MINUS (-) character (the sign of the timezone
+ offset)</li>
+
+ <li>Two digits (representing the hours component of the timezone offset)</li>
+
+ <li>A U+003A COLON character (:).</li>
+
+ <li>Two digits (representing the minutes component of the timezone offset)</li>
+
+ </ol></li>
+
+ </ul></li>
+
+ </ol><p>The aforementioned constraints are:</p>
+
+ <ul><li>The month <var title="">m</var> must be in the range
+ 0 ≤ <var title="">m</var> ≤ 12.</li>
+
+ <li>The day <var title="">d</var> must be in the range
+ 0 ≤ <var title="">d</var> ≤ <var title="">D</var> where <var title="">D</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
+ in the given month and year</a>.</li>
+
+ <li>The hour <var title="">h</var> must be in the range
+ 0 ≤ <var title="">h</var> ≤ 23.</li>
+
+ <li>The minute <var title="">m</var> must be in the range
+ 0 ≤ <var title="">m</var> ≤ 59.</li>
+
+ <li>If present, the second <var title="">s</var> (consisting of the
+ integer part and its fractional part) must be in the range
+ 0 ≤ <var title="">s</var> < 60. (The
+ values 60 and 61 are not allowed: leap seconds cannot be
+ represented by datetime values.)</li>
+
+ <li>If present, the time zone hour <var title="">h</var> must be in
+ the range 0 ≤ <var title="">h</var> ≤ 23. (However, in practice, time
+ zones do not currently ever have an hour component greater than
+ 14.)</li>
+
+ <li>If present, the time zone minute <var title="">m</var> must be
+ in the range 0 ≤ <var title="">m</var> ≤ 59. (However, in practice, time
+ zones do not currently ever have a minute component other than 0, 30,
+ or 45.)</li>
+
+ </ul><p>The digits must be characters in the range U+0030 DIGIT ZERO to
+ U+0039 DIGIT NINE, used to express numbers in base ten.</p>
+
<div class=example>
- <p>The following are some examples of dates written as <a href=#valid-datetime title="valid datetime">valid datetimes</a>.</p>
+ <p>The following are some examples of dates written as <a href=#valid-global-date-and-time-string title="valid global date and time string">valid global date and
+ time strings</a>.</p>
- <dl><dt>"<code>0037-12-13 00:00 Z</code>"</dt>
+ <dl><dt>"<code>0037-12-13T00:00Z</code>"</dt>
<dd>Midnight UTC on the birthday of Nero (the Roman Emperor).</dd>
@@ -2740,11 +2807,12 @@
zone in use on the east coast of North America during daylight
saving time.</dd>
- <dt>"<code>8592-01-01 T 02:09 +02:09</code>"</dt>
+ <dt>"<code>8592-01-01T02:09+02:09</code>"</dt>
<dd>Midnight UTC on the 1st of January, 8592. The time zone
associated with that time is two hours and nine minutes ahead of
- UTC.</dd>
+ UTC, which is not a real time zone currently, but is nonetheless
+ allowed.</dd>
</dl><p>Several things are notable about these dates:</p>
@@ -2764,23 +2832,18 @@
<li>The time and timezone components are not optional.</li>
- <li>Dates before the year 0 or after the year 9999 can't be
- represented as a datetime in this version of HTML.</li>
+ <li>Dates before the year zero can't be represented as a datetime
+ in this version of HTML.</li>
<li>Time zones differ based on daylight savings time.</li>
</ul></div>
- <p class=note>Conformance checkers can use the algorithm below to
- determine if a datetime is a valid datetime or not.</p>
-
- <p>To <dfn id=datetime-parser>parse a string as a datetime
- value</dfn>, a user agent must apply the following algorithm to the
- string. This will either return a time in UTC, with associated
+ <p>The rules to <dfn id=parse-a-global-date-and-time-string>parse a global date and time string</dfn> are
+ as follows. This will either return a time in UTC, with associated
timezone information for round tripping or display purposes, or
- nothing, indicating the value is not a <a href=#valid-datetime>valid
- datetime</a>. If at any point the algorithm says that it "fails",
- this means that it returns nothing.</p>
+ 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>
@@ -2790,9 +2853,9 @@
<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 four characters long, then fail. Otherwise,
- interpret the resulting sequence as a base-ten integer. Let that
- number be the <var title="">year</var>.</li>
+ sequence is not at least four characters long, then
+ fail. Otherwise, interpret the resulting sequence as a base-ten
+ integer. Let that number be the <var title="">year</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+002D HYPHEN-MINUS character,
then fail. Otherwise, move <var title="">position</var> forwards
@@ -2805,7 +2868,8 @@
number be the <var title="">month</var>.</li>
<li>If <var title="">month</var> is not a number in the range
- 1 ≤ <var title="">month</var> ≤ 12, then fail.</li>
+ 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>number of days
in month <var title="">month</var> of year <var title="">year</var></a>.</li>
@@ -2823,10 +2887,9 @@
<li><p>If <var title="">day</var> is not a number in the range
1 ≤ <var title="">month</var> ≤ <var title="">maxday</var>, then fail.</li>
- <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
- either U+0054 LATIN CAPITAL LETTER T characters or <a href=#space-character title="space character">space characters</a>. If the collected
- sequence is zero characters long, or if it contains more than one
- U+0054 LATIN CAPITAL LETTER T character, then fail.</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+0054 LATIN CAPITAL LETTER T
+ 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
@@ -2835,11 +2898,12 @@
number be the <var title="">hour</var>.</li>
<li>If <var title="">hour</var> is not a number in the range
- 0 ≤ <var title="">hour</var> ≤ 23, then fail.</li>
+ 0 ≤ <var title="">hour</var> ≤ 23, then
+ fail.</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>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
@@ -2848,16 +2912,19 @@
number be the <var title="">minute</var>.</li>
<li>If <var title="">minute</var> is not a number in the range
- 0 ≤ <var title="">minute</var> ≤ 59, then fail.</li>
+ 0 ≤ <var title="">minute</var> ≤ 59, then
+ fail.</li>
<li><p>Let <var title="">second</var> be a string with the value
"0".</li>
<li><p>If <var title="">position</var> is beyond the end of <var title="">input</var>, then fail.</li>
- <li><p>If the character at <var title="">position</var> is a U+003A
- COLON, then:</p>
+ <li>
+ <p>If the character at <var title="">position</var> is a U+003A
+ COLON, then run these substeps:</p>
+
<ol><li><p>Advance <var title="">position</var> to the next character
in <var title="">input</var>.</li>
@@ -2876,35 +2943,32 @@
</ol></li>
<li><p>Interpret <var title="">second</var> as a base-ten number
- (possibly with a fractional part). Let that number be <var title="">second</var> instead of the string version.</li>
+ (possibly with a fractional part). Let <var title="">second</var>
+ be that number instead of the string version.</li>
<li>If <var title="">second</var> is not a number in the range
0 ≤ <var title="">second</var> < 60, then
- fail. (The values 60 and 61 are not allowed: leap seconds cannot be
- represented by datetime values.)</li>
+ fail.</li>
<li><p>If <var title="">position</var> is beyond the end of <var title="">input</var>, then fail.</li>
- <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
+ <li>
- <li><p>If the character at <var title="">position</var> is a
- U+005A LATIN CAPITAL LETTER Z, then:</p>
+ <p>If the character at <var title="">position</var> is a U+005A
+ LATIN CAPITAL LETTER Z, then:</p>
- <ol><li><p>Let <var title="">timezone<sub title="">hours</sub></var> be
- 0.</li>
+ <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>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></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>
- <li><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>
@@ -2918,9 +2982,8 @@
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="">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>
@@ -2934,9 +2997,8 @@
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="">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>
@@ -2957,21 +3019,8 @@
<li><p>Return <var title="">time</var> and <var title="">timezone</var>.</li>
- </ol><h5 id=utc-dates-and-times><span class=secno>2.4.4.2 </span>UTC dates and times</h5>
+ </ol><h5 id=local-dates-and-times><span class=secno>2.4.4.2 </span>Local dates and times</h5>
- <p>A <dfn id=concept-datetime title=concept-datetime>UTC date and time</dfn> consists
- of a specific Gregorian date expressed relative to the UTC timezone,
- consisting of a year, a month, a day, an hour, a minute, a second,
- and a fraction of a second. <a href=#refsGREGORIAN>[GREGORIAN]</a></p>
-
- <p class=XXX>... <dfn id=valid-utc-date-and-time-string>valid UTC date and time string</dfn></p>
-
- <p class=XXX>... rules to <dfn id=parse-a-utc-date-and-time-string>parse a UTC date and time
- string</dfn></p>
-
-
- <h5 id=local-dates-and-times><span class=secno>2.4.4.3 </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 Gregorian date with no timezone information,
consisting of a year, a month, a day, an hour, a minute, a second,
@@ -2983,7 +3032,7 @@
string</dfn></p>
- <h5 id=dates><span class=secno>2.4.4.4 </span>Dates</h5>
+ <h5 id=dates><span class=secno>2.4.4.3 </span>Dates</h5>
<p>A <dfn id=concept-date title=concept-date>date</dfn> consists of a specific
Gregorian date with no timezone information, consisting of a year, a
@@ -2994,7 +3043,7 @@
<p class=XXX>... rules to <dfn id=parse-a-date-string>parse a date string</dfn></p>
- <h5 id=months><span class=secno>2.4.4.5 </span>Months</h5>
+ <h5 id=months><span class=secno>2.4.4.4 </span>Months</h5>
<p>A <dfn id=concept-month title=concept-month>month</dfn> consists of a specific
Gregorian date with no timezone information and no date information
@@ -3005,7 +3054,7 @@
<p class=XXX>... rules to <dfn id=parse-a-month-string>parse a month string</dfn></p>
- <h5 id=weeks><span class=secno>2.4.4.6 </span>Weeks</h5>
+ <h5 id=weeks><span class=secno>2.4.4.5 </span>Weeks</h5>
<p>A <dfn id=concept-week title=concept-week>week</dfn> consists of a specific
Gregorian date with no timezone information and no date information
@@ -3018,7 +3067,7 @@
<p class=XXX>... rules to <dfn id=parse-a-week-string>parse a week string</dfn></p>
- <h5 id=times><span class=secno>2.4.4.7 </span>Times</h5>
+ <h5 id=times><span class=secno>2.4.4.6 </span>Times</h5>
<p>A <dfn id=concept-time title=concept-time>time</dfn> consists of a specific
time with no timezone information, consisting of an hour, a minute,
@@ -3030,7 +3079,7 @@
- <h5 id=vaguer-moments-in-time><span class=secno>2.4.4.8 </span>Vaguer moments in time</h5>
+ <h5 id=vaguer-moments-in-time><span class=secno>2.4.4.7 </span>Vaguer moments in time</h5>
<p>This section defines <dfn id=date-or-time-string title="date or time string">date or
time strings</dfn>. There are two kinds, <dfn id=date-or-time-string-in-content title="date or time
@@ -3323,7 +3372,7 @@
<li><p>Abort these steps (the string is parsed).</li>
- </ol><h5 id=time-offsets><span class=secno>2.4.4.9 </span>Time offsets</h5>
+ </ol><h5 id=time-offsets><span class=secno>2.4.4.8 </span>Time offsets</h5>
<p class=XXX><dfn id=valid-time-offset>valid time offset</dfn>, <dfn id=rules-for-parsing-time-offsets>rules for
parsing time offsets</dfn>, <dfn id=time-offset-serialization-rules>time offset serialization
@@ -13606,16 +13655,17 @@
attribute may be used to specify the time and date of the change.</p>
<p>If present, the <code title=attr-mod-datetime><a href=#attr-mod-datetime>datetime</a></code>
- attribute must be a <a href=#valid-datetime>valid datetime</a> value.</p>
+ attribute must be a <a href=#valid-global-date-and-time-string>valid global date and time string</a>
+ value.</p>
<p>User agents must parse the <code title=attr-mod-datetime><a href=#attr-mod-datetime>datetime</a></code> attribute according to the
- <a href=#datetime-parser>parse a string as a datetime value</a> algorithm. If that
+ <a href=#parse-a-global-date-and-time-string>parse a global date and time string</a> algorithm. If that
doesn't return a time, then the modification has no associated
- timestamp (the value is non-conforming; it is not a <a href=#valid-datetime>valid
- datetime</a>). Otherwise, the modification is marked as having
- been made at the given datetime. User agents should use the
- associated timezone information to determine which timezone to
- present the given datetime in.</p>
+ timestamp (the value is non-conforming; it is not a <a href=#valid-global-date-and-time-string>valid
+ global date and time string</a>). Otherwise, the modification is
+ marked as having been made at the given datetime. User agents should
+ use the associated timezone information to determine which timezone
+ to present the given datetime in.</p>
<p>The <code><a href=#the-ins-element>ins</a></code> and <code><a href=#the-del-element>del</a></code> elements must implement
the <code><a href=#htmlmodelement>HTMLModElement</a></code> interface:</p>
@@ -24298,35 +24348,41 @@
<p>The <code><a href=#the-input-element>input</a></code> element represents a control for setting
the element's <a href=#concept-fe-value title=concept-fe-value>value</a> to a
- string representing a specific <a href=#concept-datetime title=concept-datetime>UTC
+ string representing a specific <a href=#concept-datetime title=concept-datetime>global
date and time</a>. User agents may display the date and time in
whatever timezone is appropriate for the user.</p>
<p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
- the user agent should allow the user to change the <a href=#concept-datetime title=concept-datetime>UTC date and time</a> represented by its
- <a href=#concept-fe-value title=concept-fe-value>value</a>, as obtained by <a href=#parse-a-utc-date-and-time-string title="parse a UTC date and time string">parsing a UTC date and
- time</a> from it. User agents must not allow the user to set the
- <a href=#concept-fe-value title=concept-fe-value>value</a> to a string that is not
- a <a href=#valid-utc-date-and-time-string>valid UTC date and time string</a>. If the user agent
- provides a user interface for selecting a <a href=#concept-datetime title=concept-datetime>UTC date and time</a>, then the <a href=#concept-fe-value title=concept-fe-value>value</a> must be set to a <a href=#valid-utc-date-and-time-string>valid
- UTC date and time string</a> representing the user's
- selection. User agents should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
+ the user agent should allow the user to change the <a href=#concept-datetime title=concept-datetime>global date and time</a> represented by
+ its <a href=#concept-fe-value title=concept-fe-value>value</a>, as obtained by
+ <a href=#parse-a-global-date-and-time-string title="parse a global date and time string">parsing a global
+ date and time</a> from it. User agents must not allow the user to
+ set the <a href=#concept-fe-value title=concept-fe-value>value</a> to a string that
+ is not a <a href=#valid-global-date-and-time-string>valid global date and time string</a> expressed in
+ UTC, though user agents may allow the user to set and view the time
+ in another timezone and silently translate the time to and from the
+ UTC timezone in the <a href=#concept-fe-value title=concept-fe-value>value</a>. If
+ the user agent provides a user interface for selecting a <a href=#concept-datetime title=concept-datetime>global date and time</a>, then the <a href=#concept-fe-value title=concept-fe-value>value</a> must be set to a <a href=#valid-global-date-and-time-string>valid
+ global date and time string</a> expressed in UTC representing the
+ user's selection. User agents should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
<p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
- specified, must have a value that is a <a href=#valid-utc-date-and-time-string>valid UTC date and time
- string</a>.</p> <!-- ok to set out-of-range value, we never know
- when we might have to represent bogus input -->
+ specified, must have a value that is a <a href=#valid-global-date-and-time-string>valid global date and
+ time string</a>.</p> <!-- ok to set out-of-range value, we never
+ know when we might have to represent bogus input -->
<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as
follows:</strong> If the <a href=#concept-fe-value title=concept-fe-value>value</a>
- of the element is not a <a href=#valid-utc-date-and-time-string>valid UTC date and time string</a>,
- then set it to the empty string instead.</p>
+ of the element is a <a href=#valid-global-date-and-time-string>valid global date and time string</a>,
+ then adjust the time so that the <a href=#concept-fe-value title=concept-fe-value>value</a> represents the same point in
+ time but expressed in the UTC timezone, otherwise, set it to the
+ empty string instead.</p>
<p>The <code title=attr-input-min><a href=#attr-input-min>min</a></code> attribute, if
- specified, must have a value that is a <a href=#valid-utc-date-and-time-string>valid UTC date and time
- string</a>. The <code title=attr-input-max><a href=#attr-input-max>max</a></code>
- attribute, if specified, must have a value that is a <a href=#valid-utc-date-and-time-string>valid UTC
- date and time string</a>.</p>
+ specified, must have a value that is a <a href=#valid-global-date-and-time-string>valid global date and
+ time string</a>. The <code title=attr-input-max><a href=#attr-input-max>max</a></code>
+ attribute, if specified, must have a value that is a <a href=#valid-global-date-and-time-string>valid
+ global date and time string</a>.</p>
<p>The <code title=attr-input-step><a href=#attr-input-step>step</a></code> attribute is
expressed in seconds. The <a href=#concept-input-step-scale title=concept-input-step-scale>step scale factor</a> is 1000
@@ -24335,37 +24391,38 @@
step</a> is 60 seconds.</p>
<p>When the element is <a href=#suffering-from-a-step-mismatch>suffering from a step mismatch</a>,
- the user agent may round the element's <a href=#concept-fe-value title=concept-fe-value>value</a> to the nearest <a href=#concept-datetime title=concept-datetime>UTC date and time</a> for which the
+ the user agent may round the element's <a href=#concept-fe-value title=concept-fe-value>value</a> to the nearest <a href=#concept-datetime title=concept-datetime>global date and time</a> for which the
element would not <a href=#suffering-from-a-step-mismatch title="suffering from a step
mismatch">suffer from a step mismatch</a>.</p>
<p><strong>The <a href=#concept-input-value-string-number title=concept-input-value-string-number>algorithm to convert a
string to a number</a>, given a string <var title="">input</var>,
- is as follows:</strong> If <a href=#parse-a-utc-date-and-time-string title="parse a UTC date and time
- string">parsing a UTC date and time</a> from <var title="">input</var> results in an error, then return an error;
+ is as follows:</strong> If <a href=#parse-a-global-date-and-time-string title="parse a global date and time
+ string">parsing a global date and time</a> from <var title="">input</var> results in an error, then return an error;
otherwise, return the number of milliseconds elapsed from midnight
UTC on the morning of 1970-01-01 (the time represented by the value
- "<code title="">1970-01-01T00:00:00.0Z</code>") to the parsed <a href=#concept-datetime title=concept-datetime>UTC date and time</a>, ignoring leap
+ "<code title="">1970-01-01T00:00:00.0Z</code>") to the parsed <a href=#concept-datetime title=concept-datetime>global date and time</a>, ignoring leap
seconds.</p>
<p><strong>The <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a
number to a string</a>, given a number <var title="">input</var>,
- is as follows:</strong> Return a <a href=#valid-utc-date-and-time-string>valid UTC date and time
- string</a> that represents the <a href=#concept-datetime title=concept-datetime>date and time in UTC</a> that is <var title="">input</var> milliseconds after midnight UTC on the morning
+ is as follows:</strong> Return a <a href=#valid-global-date-and-time-string>valid global date and time
+ string</a> expressed in UTC that represents the <a href=#concept-datetime title=concept-datetime>global date and time</a> that is <var title="">input</var> milliseconds after midnight UTC on the morning
of 1970-01-01 (the time represented by the value "<code title="">1970-01-01T00:00:00.0Z</code>").</p>
<p><strong>The <a href=#concept-input-value-string-date title=concept-input-value-string-date>algorithm to convert a
- string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows:</strong> If <a href=#parse-a-utc-date-and-time-string title="parse
- a UTC date and time string">parsing a UTC date and time</a> from
- <var title="">input</var> results in an error, then return an error;
- otherwise, return a <code>Date</code> object representing the parsed
- <a href=#concept-datetime title=concept-datetime>UTC date and time</a>.</p>
+ string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows:</strong> If <a href=#parse-a-global-date-and-time-string title="parse
+ a global date and time string">parsing a global date and time</a>
+ from <var title="">input</var> results in an error, then return an
+ error; otherwise, return a <code>Date</code> object representing the
+ parsed <a href=#concept-datetime title=concept-datetime>global date and time</a>,
+ expressed in UTC.</p>
<p><strong>The <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, given a
<code>Date</code> object <var title="">input</var>, is as
- follows:</strong> Return a <a href=#valid-utc-date-and-time-string>valid UTC date and time
- string</a> that represents the <a href=#concept-datetime title=concept-datetime>date and time in UTC</a> that is
+ follows:</strong> Return a <a href=#valid-global-date-and-time-string>valid global date and time
+ string</a> expressed in UTC that represents the <a href=#concept-datetime title=concept-datetime>global date and time</a> that is
represented by <var title="">input</var>.</p>
<div class=bookkeeping>
Modified: source
===================================================================
--- source 2008-10-29 22:30:17 UTC (rev 2380)
+++ source 2008-10-30 00:21:51 UTC (rev 2381)
@@ -1953,58 +1953,150 @@
href="#refsGREGORIAN">[GREGORIAN]</a></p>
- <h5>Specific moments in time</h5>
+ <h5>Global dates and times</h5>
- <p class="XXX">This syntax is going to be tightened up and
- made almost exactly the same as the <span>valid UTC date and time
- string</span> syntax, with the exception of allowing time zones. In
- fact what we might do is allow time zones in general, use the same
- parser, etc, but require that UAs always use the UTC time zone when
- synthesizing datetimes for form submission.</p>
+ <p>A <dfn title="concept-datetime">global date and time</dfn>
+ consists of a specific Gregorian date, consisting of a year, a
+ month, a day, an hour, a minute, a second, and a fraction of a
+ second, expressed with a time zone, consisting of a number of hours
+ and minutes. <a href="#refsGREGORIAN">[GREGORIAN]</a></p>
- <p>A string is a <dfn>valid datetime</dfn> if it has four digits
- (representing the year), a literal hyphen, two digits (representing
- the month), a literal hyphen, two digits (representing the day),
- optionally some spaces, either a literal T or a space, optionally
- some more spaces, two digits (for the hour), a colon, two digits
- (the minutes), optionally the seconds (which, if included, must
- consist of another colon, two digits (the integer part of the
- seconds), and optionally a decimal point followed by one or more
- digits (for the fractional part of the seconds)), optionally some
- spaces, and finally either a literal Z (indicating the time zone is
- UTC), or, a plus sign or a minus sign followed by two digits, a
- colon, and two digits (for the sign, the hours and minutes of the
- timezone offset respectively); with the month-day combination being
- a valid date in the given year according to the Gregorian calendar,
- the hour values (<var title="">h</var>) being in the range
- 0 ≤ <var title="">h</var> ≤ 23, the minute
- values (<var title="">m</var>) in the range 0 ≤ <var
- title="">m</var> ≤ 59, and the second value (<var
- title="">s</var>) being in the range 0 ≤ <var
- title="">h</var> < 60. <a
- href="#refsGREGORIAN">[GREGORIAN]</a></p>
-
<!--XXX [GREGORIAN] should point to
<dd id="refsGREGORIAN">[GREGORIAN]</dd>
<dd>(Non-normative) <cite>Inter Gravissimas</cite>, A. Lilius, C. Clavius. Gregory XIII Papal Bulls, February 1582.</dd>
-->
- <p>The digits must be characters in the range U+0030 DIGIT ZERO (0)
- to U+0039 DIGIT NINE (9), the hyphens must be a U+002D HYPHEN-MINUS
- characters, the T must be a U+0054 LATIN CAPITAL LETTER T, the
- colons must be U+003A COLON characters, the decimal point must be a
- U+002E FULL STOP, the Z must be a U+005A LATIN CAPITAL LETTER Z, the
- plus sign must be a U+002B PLUS SIGN, and the minus U+002D (same as
- the hyphen).</p>
+ <p>A string is a <dfn>valid global date and time string</dfn> if it
+ has the components in the following list, in the given order, and if
+ the components in the list follow the constraints given after the
+ list:</p>
+ <ol>
+
+ <li>Four or more digits (representing the year)</li>
+
+ <li>A U+002D HYPHEN-MINUS character (-).</li>
+
+ <li>Two digits (representing the month)</li>
+
+ <li>A U+002D HYPHEN-MINUS character (-).</li>
+
+ <li>Two digits (representing the day)</li>
+
+ <li>A U+0054 LATIN CAPITAL LETTER T character.</li>
+
+ <li>Two digits (representing the hour)</li>
+
+ <li>A U+003A COLON character (:).</li>
+
+ <li>Two digits (representing the minutes)</li>
+
+ <li>Optionally:
+
+ <ol>
+
+ <li>A U+003A COLON character (:).</li>
+
+ <li>Two digits (representing the integer part of the seconds)</li>
+
+ <li>Optionally:
+
+ <ol>
+
+ <li>A 002E FULL STOP character (.)</li>
+
+ <li>One or more digits (representing the fractional part of the seconds)</li>
+
+ </ol>
+
+ </li>
+
+ </ol>
+
+ </li>
+
+ <li>Either:
+
+ <ul>
+
+ <li>A U+005A LATIN CAPITAL LETTER Z character (indicating the
+ time zone is UTC)</li>
+
+ <li>Or:
+
+ <ol>
+
+ <li>Either a U+002B PLUS SIGN character (+) or a U+002D
+ HYPHEN-MINUS (-) character (the sign of the timezone
+ offset)</li>
+
+ <li>Two digits (representing the hours component of the timezone offset)</li>
+
+ <li>A U+003A COLON character (:).</li>
+
+ <li>Two digits (representing the minutes component of the timezone offset)</li>
+
+ </ol>
+
+ </li>
+
+ </ul>
+
+ </li>
+
+ </ol>
+
+ <p>The aforementioned constraints are:</p>
+
+ <ul>
+
+ <li>The month <var title="">m</var> must be in the range
+ 0 ≤ <var title="">m</var> ≤ 12.</li>
+
+ <li>The day <var title="">d</var> must be in the range
+ 0 ≤ <var title="">d</var> ≤ <var
+ title="">D</var> where <var title="">D</var> is the <span
+ title="number of days in month month of year year">number of days
+ in the given month and year</span>.</li>
+
+ <li>The hour <var title="">h</var> must be in the range
+ 0 ≤ <var title="">h</var> ≤ 23.</li>
+
+ <li>The minute <var title="">m</var> must be in the range
+ 0 ≤ <var title="">m</var> ≤ 59.</li>
+
+ <li>If present, the second <var title="">s</var> (consisting of the
+ integer part and its fractional part) must be in the range
+ 0 ≤ <var title="">s</var> < 60. (The
+ values 60 and 61 are not allowed: leap seconds cannot be
+ represented by datetime values.)</li>
+
+ <li>If present, the time zone hour <var title="">h</var> must be in
+ the range 0 ≤ <var
+ title="">h</var> ≤ 23. (However, in practice, time
+ zones do not currently ever have an hour component greater than
+ 14.)</li>
+
+ <li>If present, the time zone minute <var title="">m</var> must be
+ in the range 0 ≤ <var
+ title="">m</var> ≤ 59. (However, in practice, time
+ zones do not currently ever have a minute component other than 0, 30,
+ or 45.)</li>
+
+ </ul>
+
+ <p>The digits must be characters in the range U+0030 DIGIT ZERO to
+ U+0039 DIGIT NINE, used to express numbers in base ten.</p>
+
<div class="example">
<p>The following are some examples of dates written as <span
- title="valid datetime">valid datetimes</span>.</p>
+ title="valid global date and time string">valid global date and
+ time strings</span>.</p>
<dl>
- <dt>"<code>0037-12-13 00:00 Z</code>"</dt>
+ <dt>"<code>0037-12-13T00:00Z</code>"</dt>
<dd>Midnight UTC on the birthday of Nero (the Roman Emperor).</dd>
@@ -2014,11 +2106,12 @@
zone in use on the east coast of North America during daylight
saving time.</dd>
- <dt>"<code>8592-01-01 T 02:09 +02:09</code>"</dt>
+ <dt>"<code>8592-01-01T02:09+02:09</code>"</dt>
<dd>Midnight UTC on the 1st of January, 8592. The time zone
associated with that time is two hours and nine minutes ahead of
- UTC.</dd>
+ UTC, which is not a real time zone currently, but is nonetheless
+ allowed.</dd>
</dl>
@@ -2042,8 +2135,8 @@
<li>The time and timezone components are not optional.</li>
- <li>Dates before the year 0 or after the year 9999 can't be
- represented as a datetime in this version of HTML.</li>
+ <li>Dates before the year zero can't be represented as a datetime
+ in this version of HTML.</li>
<li>Time zones differ based on daylight savings time.</li>
@@ -2051,16 +2144,11 @@
</div>
- <p class="note">Conformance checkers can use the algorithm below to
- determine if a datetime is a valid datetime or not.</p>
-
- <p>To <dfn id="datetime-parser">parse a string as a datetime
- value</dfn>, a user agent must apply the following algorithm to the
- string. This will either return a time in UTC, with associated
+ <p>The rules to <dfn>parse a global date and time string</dfn> are
+ as follows. This will either return a time in UTC, with associated
timezone information for round tripping or display purposes, or
- nothing, indicating the value is not a <span>valid
- datetime</span>. If at any point the algorithm says that it "fails",
- this means that it returns nothing.</p>
+ 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>
@@ -2073,9 +2161,9 @@
<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 four characters long, then fail. Otherwise,
- interpret the resulting sequence as a base-ten integer. Let that
- number be the <var title="">year</var>.</p></li>
+ sequence is not at least four characters long, then
+ fail. Otherwise, interpret the resulting sequence as a base-ten
+ integer. Let that number be the <var title="">year</var>.</p></li>
<li><p>If <var title="">position</var> is beyond the end of <var
title="">input</var> or if the character at <var
@@ -2090,7 +2178,8 @@
number be the <var title="">month</var>.</p></li>
<li>If <var title="">month</var> is not a number in the range
- 1 ≤ <var title="">month</var> ≤ 12, then fail.</li>
+ 1 ≤ <var title="">month</var> ≤ 12, then
+ fail.</li>
<li><p>Let <var title="">maxday</var> be the <span>number of days
in month <var title="">month</var> of year <var
@@ -2112,11 +2201,11 @@
1 ≤ <var title="">month</var> ≤ <var
title="">maxday</var>, then fail.</li>
- <li><p><span>Collect a sequence of characters</span> that are
- either U+0054 LATIN CAPITAL LETTER T characters or <span
- title="space character">space characters</span>. If the collected
- sequence is zero characters long, or if it contains more than one
- U+0054 LATIN CAPITAL LETTER T character, then fail.</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+0054 LATIN CAPITAL LETTER T
+ 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
@@ -2125,13 +2214,14 @@
number be the <var title="">hour</var>.</p></li>
<li>If <var title="">hour</var> is not a number in the range
- 0 ≤ <var title="">hour</var> ≤ 23, then fail.</li>
+ 0 ≤ <var title="">hour</var> ≤ 23, then
+ fail.</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>
+ 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
@@ -2140,7 +2230,8 @@
number be the <var title="">minute</var>.</p></li>
<li>If <var title="">minute</var> is not a number in the range
- 0 ≤ <var title="">minute</var> ≤ 59, then fail.</li>
+ 0 ≤ <var title="">minute</var> ≤ 59, then
+ fail.</li>
<li><p>Let <var title="">second</var> be a string with the value
"0".</p></li>
@@ -2148,9 +2239,11 @@
<li><p>If <var title="">position</var> is beyond the end of <var
title="">input</var>, then fail.</p></li>
- <li><p>If the character at <var title="">position</var> is a U+003A
- COLON, then:</p>
+ <li>
+ <p>If the character at <var title="">position</var> is a U+003A
+ COLON, then run these substeps:</p>
+
<ol>
<li><p>Advance <var title="">position</var> to the next character
@@ -2177,41 +2270,38 @@
</li>
<li><p>Interpret <var title="">second</var> as a base-ten number
- (possibly with a fractional part). Let that number be <var
- title="">second</var> instead of the string version.</p></li>
+ (possibly with a fractional part). Let <var title="">second</var>
+ be that number instead of the string version.</p></li>
<li>If <var title="">second</var> is not a number in the range
0 ≤ <var title="">second</var> < 60, then
- fail. (The values 60 and 61 are not allowed: leap seconds cannot be
- represented by datetime values.)</li>
+ fail.</li>
<li><p>If <var title="">position</var> is beyond the end of <var
title="">input</var>, then fail.</p></li>
- <li><p><span>Skip whitespace</span>.</p></li>
+ <li>
- <li><p>If the character at <var title="">position</var> is a
- U+005A LATIN CAPITAL LETTER Z, then:</p>
+ <p>If the character at <var title="">position</var> is a U+005A
+ LATIN CAPITAL LETTER 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="">hours</sub></var>
+ be 0.</p></li>
- <li><p>Let <var title="">timezone<sub title="">minutes</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>
- </li>
+ <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>
- <li><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
@@ -2226,13 +2316,13 @@
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>
+ 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="">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>
@@ -2247,13 +2337,13 @@
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>
+ 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="">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>
@@ -2285,20 +2375,6 @@
</ol>
- <h5>UTC dates and times</h5>
-
- <p>A <dfn title="concept-datetime">UTC date and time</dfn> consists
- of a specific Gregorian date expressed relative to the UTC timezone,
- consisting of a year, a month, a day, an hour, a minute, a second,
- and a fraction of a second. <a
- href="#refsGREGORIAN">[GREGORIAN]</a></p>
-
- <p class="XXX">... <dfn>valid UTC date and time string</dfn></p>
-
- <p class="XXX">... rules to <dfn>parse a UTC date and time
- string</dfn></p>
-
-
<h5>Local dates and times</h5>
<p>A <dfn title="concept-datetime-local">local date and time</dfn>
@@ -14411,17 +14487,18 @@
attribute may be used to specify the time and date of the change.</p>
<p>If present, the <code title="attr-mod-datetime">datetime</code>
- attribute must be a <span>valid datetime</span> value.</p>
+ attribute must be a <span>valid global date and time string</span>
+ value.</p>
<p>User agents must parse the <code
title="attr-mod-datetime">datetime</code> attribute according to the
- <span>parse a string as a datetime value</span> algorithm. If that
+ <span>parse a global date and time string</span> algorithm. If that
doesn't return a time, then the modification has no associated
timestamp (the value is non-conforming; it is not a <span>valid
- datetime</span>). Otherwise, the modification is marked as having
- been made at the given datetime. User agents should use the
- associated timezone information to determine which timezone to
- present the given datetime in.</p>
+ global date and time string</span>). Otherwise, the modification is
+ marked as having been made at the given datetime. User agents should
+ use the associated timezone information to determine which timezone
+ to present the given datetime in.</p>
<p>The <code>ins</code> and <code>del</code> elements must implement
the <code>HTMLModElement</code> interface:</p>
@@ -27032,40 +27109,46 @@
<p>The <code>input</code> element represents a control for setting
the element's <span title="concept-fe-value">value</span> to a
- string representing a specific <span title="concept-datetime">UTC
+ string representing a specific <span title="concept-datetime">global
date and time</span>. User agents may display the date and time in
whatever timezone is appropriate for the user.</p>
<p>If the element is <i title="concept-input-mutable">mutable</i>,
the user agent should allow the user to change the <span
- title="concept-datetime">UTC date and time</span> represented by its
- <span title="concept-fe-value">value</span>, as obtained by <span
- title="parse a UTC date and time string">parsing a UTC date and
- time</span> from it. User agents must not allow the user to set the
- <span title="concept-fe-value">value</span> to a string that is not
- a <span>valid UTC date and time string</span>. If the user agent
- provides a user interface for selecting a <span
- title="concept-datetime">UTC date and time</span>, then the <span
+ title="concept-datetime">global date and time</span> represented by
+ its <span title="concept-fe-value">value</span>, as obtained by
+ <span title="parse a global date and time string">parsing a global
+ date and time</span> from it. User agents must not allow the user to
+ set the <span title="concept-fe-value">value</span> to a string that
+ is not a <span>valid global date and time string</span> expressed in
+ UTC, though user agents may allow the user to set and view the time
+ in another timezone and silently translate the time to and from the
+ UTC timezone in the <span title="concept-fe-value">value</span>. If
+ the user agent provides a user interface for selecting a <span
+ title="concept-datetime">global date and time</span>, then the <span
title="concept-fe-value">value</span> must be set to a <span>valid
- UTC date and time string</span> representing the user's
- selection. User agents should allow the user to set the <span
+ global date and time string</span> expressed in UTC representing the
+ user's selection. User agents should allow the user to set the <span
title="concept-fe-value">value</span> to the empty string.</p>
<p>The <code title="attr-input-value">value</code> attribute, if
- specified, must have a value that is a <span>valid UTC date and time
- string</span>.</p> <!-- ok to set out-of-range value, we never know
- when we might have to represent bogus input -->
+ specified, must have a value that is a <span>valid global date and
+ time string</span>.</p> <!-- ok to set out-of-range value, we never
+ know when we might have to represent bogus input -->
<p><strong>The <span>value sanitization algorithm</span> is as
follows:</strong> If the <span title="concept-fe-value">value</span>
- of the element is not a <span>valid UTC date and time string</span>,
- then set it to the empty string instead.</p>
+ of the element is a <span>valid global date and time string</span>,
+ then adjust the time so that the <span
+ title="concept-fe-value">value</span> represents the same point in
+ time but expressed in the UTC timezone, otherwise, set it to the
+ empty string instead.</p>
<p>The <code title="attr-input-min">min</code> attribute, if
- specified, must have a value that is a <span>valid UTC date and time
- string</span>. The <code title="attr-input-max">max</code>
- attribute, if specified, must have a value that is a <span>valid UTC
- date and time string</span>.</p>
+ specified, must have a value that is a <span>valid global date and
+ time string</span>. The <code title="attr-input-max">max</code>
+ attribute, if specified, must have a value that is a <span>valid
+ global date and time string</span>.</p>
<p>The <code title="attr-input-step">step</code> attribute is
expressed in seconds. The <span
@@ -27077,28 +27160,28 @@
<p>When the element is <span>suffering from a step mismatch</span>,
the user agent may round the element's <span
title="concept-fe-value">value</span> to the nearest <span
- title="concept-datetime">UTC date and time</span> for which the
+ title="concept-datetime">global date and time</span> for which the
element would not <span title="suffering from a step
mismatch">suffer from a step mismatch</span>.</p>
<p><strong>The <span
title="concept-input-value-string-number">algorithm to convert a
string to a number</span>, given a string <var title="">input</var>,
- is as follows:</strong> If <span title="parse a UTC date and time
- string">parsing a UTC date and time</span> from <var
+ is as follows:</strong> If <span title="parse a global date and time
+ string">parsing a global date and time</span> from <var
title="">input</var> results in an error, then return an error;
otherwise, return the number of milliseconds elapsed from midnight
UTC on the morning of 1970-01-01 (the time represented by the value
"<code title="">1970-01-01T00:00:00.0Z</code>") to the parsed <span
- title="concept-datetime">UTC date and time</span>, ignoring leap
+ title="concept-datetime">global date and time</span>, ignoring leap
seconds.</p>
<p><strong>The <span
title="concept-input-value-number-string">algorithm to convert a
number to a string</span>, given a number <var title="">input</var>,
- is as follows:</strong> Return a <span>valid UTC date and time
- string</span> that represents the <span
- title="concept-datetime">date and time in UTC</span> that is <var
+ is as follows:</strong> Return a <span>valid global date and time
+ string</span> expressed in UTC that represents the <span
+ title="concept-datetime">global date and time</span> that is <var
title="">input</var> milliseconds after midnight UTC on the morning
of 1970-01-01 (the time represented by the value "<code
title="">1970-01-01T00:00:00.0Z</code>").</p>
@@ -27107,18 +27190,19 @@
title="concept-input-value-string-date">algorithm to convert a
string to a <code>Date</code> object</span>, given a string <var
title="">input</var>, is as follows:</strong> If <span title="parse
- a UTC date and time string">parsing a UTC date and time</span> from
- <var title="">input</var> results in an error, then return an error;
- otherwise, return a <code>Date</code> object representing the parsed
- <span title="concept-datetime">UTC date and time</span>.</p>
+ a global date and time string">parsing a global date and time</span>
+ from <var title="">input</var> results in an error, then return an
+ error; otherwise, return a <code>Date</code> object representing the
+ parsed <span title="concept-datetime">global date and time</span>,
+ expressed in UTC.</p>
<p><strong>The <span
title="concept-input-value-date-string">algorithm to convert a
<code>Date</code> object to a string</span>, given a
<code>Date</code> object <var title="">input</var>, is as
- follows:</strong> Return a <span>valid UTC date and time
- string</span> that represents the <span
- title="concept-datetime">date and time in UTC</span> that is
+ follows:</strong> Return a <span>valid global date and time
+ string</span> expressed in UTC that represents the <span
+ title="concept-datetime">global date and time</span> that is
represented by <var title="">input</var>.</p>
<div class="bookkeeping">
More information about the Commit-Watchers
mailing list