- From: poot <cvsmail@w3.org>
- Date: Thu, 30 Oct 2008 10:44:02 +0900 (JST)
- To: public-html-diffs@w3.org
Define 'month' syntax, and tighten up the rest of the datetime definitions. (whatwg r2383) valid date string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#valid-date-string parse a date component http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#parse-a-date-component parse a local date and time string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#parse-a-local-date-and-time-string parse a date string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#parse-a-date-string valid global date and time string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#valid-global-date-and-time-string digits http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#concept-datetime-digit parse a time component http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#parse-a-time-component 2.4.4.4 Local dates and times http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#local-dates-and-times 2.4.4.5 Global dates and times http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#global-dates-and-times valid time string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#valid-time-string parse a time string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#parse-a-time-string 2.4.4.6 Weeks http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#weeks parse a month string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#parse-a-month-string valid week string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#valid-week-string parse a month component http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#parse-a-month-component parse a global date and time string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#parse-a-global-date-and-time-string valid month string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#valid-month-string 2.4.4.2 Dates http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#dates 2.4.4.1 Months http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#months 2.4.4.3 Times http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#times valid local date and time string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#valid-local-date-and-time-string date or time strings in content http://people.w3.org/mike/diffs/html5/spec/Overview.1.1555.html#date-or-time-string-in-content http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1554&r2=1.1555&f=h http://html5.org/tools/web-apps-tracker?from=2382&to=2383 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.1554 retrieving revision 1.1555 diff -u -d -r1.1554 -r1.1555 --- Overview.html 30 Oct 2008 00:58:16 -0000 1.1554 +++ Overview.html 30 Oct 2008 01:39:29 -0000 1.1555 @@ -164,11 +164,11 @@ <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=#dates><span class=secno>2.4.4.1 </span>Dates</a></li> - <li><a href=#times><span class=secno>2.4.4.2 </span>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=#global-dates-and-times><span class=secno>2.4.4.4 </span>Global dates and times</a></li> - <li><a href=#months><span class=secno>2.4.4.5 </span>Months</a></li> + <li><a href=#months><span class=secno>2.4.4.1 </span>Months</a></li> + <li><a href=#dates><span class=secno>2.4.4.2 </span>Dates</a></li> + <li><a href=#times><span class=secno>2.4.4.3 </span>Times</a></li> + <li><a href=#local-dates-and-times><span class=secno>2.4.4.4 </span>Local dates and times</a></li> + <li><a href=#global-dates-and-times><span class=secno>2.4.4.5 </span>Global dates and times</a></li> <li><a href=#weeks><span class=secno>2.4.4.6 </span>Weeks</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> @@ -2233,48 +2233,37 @@ Gregorian calendar. <a href=#references>[GREGORIAN]</a><p>The <dfn id=concept-datetime-digit title=concept-datetime-digit>digits</dfn> in the date and time syntaxes defined in this section must be characters in the range U+0030 DIGIT ZERO to U+0039 DIGIT NINE, used to express - numbers in base ten.<h5 id=dates><span class=secno>2.4.4.1 </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 - month, and a day. <a href=#references>[GREGORIAN]</a><p>A string is a <dfn id=valid-date-string>valid date 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:<ol><li>Four or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> (representing the year)</li> - - <li>A U+002D HYPHEN-MINUS character (-).</li> - - <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> (representing the month)</li> - - <li>A U+002D HYPHEN-MINUS character (-).</li> - - <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> (representing the day)</li> + numbers in base ten.<h5 id=months><span class=secno>2.4.4.1 </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 + beyond a year and a month. <a href=#references>[GREGORIAN]</a><p>A string is a <dfn id=valid-month-string>valid month string</dfn> representing a year + <var title="">year</var> and month <var title="">month</var> if it + consists of the following components in the given order:<ol><li>Four or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing <var title="">year</var></li> - </ol><p>The aforementioned constraints are:<ul><li>The month <var title="">m</var> must be in the range - 0 ≤ <var title="">m</var> ≤ 12.</li> + <li>A U+002D HYPHEN-MINUS character (-)</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>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, + representing the month <var title="">month</var>, in the range + 0 ≤ <var title="">month</var> ≤ 12</li> - </ul><p>The rules to <dfn id=parse-a-date-string>parse a date string</dfn> are as follows. This - will either return a date, or nothing. If at any point the algorithm - says that it "fails", this means that it is aborted at that point - and returns nothing.<ol><li><p>Let <var title="">input</var> be the string being + </ol><p>The rules to <dfn id=parse-a-month-string>parse a month string</dfn> are as follows. This + will either return a year and month, or nothing. If at any point the + algorithm says that it "fails", this means that it is aborted at + that point and returns nothing.<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-date-component>Parse a date component</a> to obtain <var title="">year</var>, <var title="">month</var>, and <var title="">day</var>. If this returns nothing, then fail.</p> + <li><p><a href=#parse-a-month-component>Parse a month component</a> to obtain <var title="">year</var> and <var title="">month</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>Let <var title="">date</var> be the date with year <var title="">year</var>, month <var title="">month</var>, and day <var title="">day</var>.</li> - - <li><p>Return <var title="">date</var>.</li> + <li><p>Return <var title="">year</var> and <var title="">month</var>.</li> - </ol><p>The rules to <dfn id=parse-a-date-component>parse a date component</dfn>, given an <var title="">input</var> string and a <var title="">position</var>, are - as follows. This will either return a year, a month, and a day, or + </ol><p>The rules to <dfn id=parse-a-month-component>parse a month component</dfn>, given an <var title="">input</var> string and a <var title="">position</var>, are + as follows. This will either return a year and a month, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.<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). If the collected @@ -2296,6 +2285,46 @@ 1 ≤ <var title="">month</var> ≤ 12, then fail.</li> + <li><p>Return <var title="">year</var> and <var title="">month</var>.</li> + + </ol><h5 id=dates><span class=secno>2.4.4.2 </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 + month, and a day. <a href=#references>[GREGORIAN]</a><p>A string is a <dfn id=valid-date-string>valid date string</dfn> representing a year + <var title="">year</var>, month <var title="">month</var>, and day + <var title="">day</var> if it consists of the following components + in the given order:<ol><li>A <a href=#valid-month-string>valid month string</a>, representing <var title="">year</var> and <var title="">month</var></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 + 0 ≤ <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 + in the month <var title="">month</var> and year <var title="">year</var></a></li> + + </ol><p>The rules to <dfn id=parse-a-date-string>parse a date string</dfn> are as follows. This + will either return a date, or nothing. If at any point the algorithm + says that it "fails", this means that it is aborted at that point + and returns nothing.<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-date-component>Parse a date component</a> to obtain <var title="">year</var>, <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>Let <var title="">date</var> be the date with year <var title="">year</var>, month <var title="">month</var>, and day <var title="">day</var>.</li> + + <li><p>Return <var title="">date</var>.</li> + + </ol><p>The rules to <dfn id=parse-a-date-component>parse a date component</dfn>, given an <var title="">input</var> string and a <var title="">position</var>, are + as follows. This will either return a year, 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.<ol><li><p><a href=#parse-a-month-component>Parse a month component</a> to obtain <var title="">year</var> and <var title="">month</var>. If this returns + nothing, 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> @@ -2315,46 +2344,43 @@ <li><p>Return <var title="">year</var>, <var title="">month</var>, and <var title="">day</var>.</li> - </ol><h5 id=times><span class=secno>2.4.4.2 </span>Times</h5><p>A <dfn id=concept-time title=concept-time>time</dfn> consists of a specific + </ol><h5 id=times><span class=secno>2.4.4.3 </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, - a second, and a fraction of a second.<p>A string is a <dfn id=valid-time-string>valid 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:<ol><li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> (representing the hour)</li> + a second, and a fraction of a second.<p>A string is a <dfn id=valid-time-string>valid time string</dfn> representing an hour + <var title="">hour</var>, a minute <var title="">minute</var>, and a + second <var title="">second</var> if it consists of the following + components in the given order:<ol><li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, + representing <var title="">hour</var>, in the range + 0 ≤ <var title="">hour</var> ≤ 23</li> - <li>A U+003A COLON character (:).</li> + <li>A U+003A COLON character (:)</li> - <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> (representing the minutes)</li> + <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, + representing <var title="">minute</var></li> - <li>Optionally: + <li>Optionally (required if <var title="">second</var> is + non-zero): - <ol><li>A U+003A COLON character (:).</li> + <ol><li>A U+003A COLON character (:)</li> - <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> (representing the integer part of the seconds)</li> + <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, + representing the integer part of <var title="">second</var>, in + the range 0 ≤ <var title="">s</var> ≤ 59</li> - <li>Optionally: + <li>Optionally (required if <var title="">second</var> is not an + integer): <ol><li>A 002E FULL STOP character (.)</li> - <li>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> (representing the fractional part of the seconds)</li> + <li>One or more <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, representing the + fractional part of <var title="">second</var></li> </ol></li> </ol></li> - </ol><p>The aforementioned constraints are:<ul><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> - - </ul><p>The rules to <dfn id=parse-a-time-string>parse a time string</dfn> are as follows. This + </ol><p class=note>The <var title="">second</var> component cannot be + 60 or 61; leap seconds cannot be represented.<p>The rules to <dfn id=parse-a-time-string>parse a time string</dfn> are as follows. This will either return a time, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.<ol><li><p>Let <var title="">input</var> be the string being @@ -2437,16 +2463,17 @@ <li><p>Return <var title="">hour</var>, <var title="">minute</var>, and <var title="">second</var>.</li> - </ol><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> + </ol><h5 id=local-dates-and-times><span class=secno>2.4.4.4 </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, 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, but expressed without a time - zone. <a href=#references>[GREGORIAN]</a><p>A string is a <dfn id=valid-local-date-and-time-string>valid local date and time string</dfn> if it - has the components in the following list, in the given order:<ol><li>A <a href=#valid-date-string>valid date string</a>.</li> + zone. <a href=#references>[GREGORIAN]</a><p>A string is a <dfn id=valid-local-date-and-time-string>valid local date and time string</dfn> + representing a date and time if it consists of the following + components in the given order:<ol><li>A <a href=#valid-date-string>valid date string</a> representing the date.</li> <li>A U+0054 LATIN CAPITAL LETTER T character.</li> - <li>A <a href=#valid-time-string>valid time string</a>.</li> + <li>A <a href=#valid-time-string>valid time string</a> representing the time.</li> </ol><p>The rules to <dfn id=parse-a-local-date-and-time-string>parse a local date and time string</dfn> are as follows. This will either return a date and time, or nothing. If at @@ -2475,54 +2502,50 @@ <li><p>Return <var title="">date</var> and <var title="">time</var>.</li> - </ol><h5 id=global-dates-and-times><span class=secno>2.4.4.4 </span>Global dates and times</h5><p>A <dfn id=concept-datetime title=concept-datetime>global date and time</dfn> + </ol><h5 id=global-dates-and-times><span class=secno>2.4.4.5 </span>Global dates and times</h5><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, 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, consisting of a number of hours and minutes. <a href=#references>[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>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:<ol><li>A <a href=#valid-date-string>valid date string</a>.</li> + --><p>A string is a <dfn id=valid-global-date-and-time-string>valid global date and time string</dfn> + representing a date, time, and a timezone offset if it consists of + the following components in the given order:<ol><li>A <a href=#valid-date-string>valid date string</a> representing the date</li> - <li>A U+0054 LATIN CAPITAL LETTER T character.</li> + <li>A U+0054 LATIN CAPITAL LETTER T character</li> - <li>A <a href=#valid-time-string>valid time string</a>.</li> + <li>A <a href=#valid-time-string>valid time string</a> representing the time</li> <li>Either: - <ul><li>A U+005A LATIN CAPITAL LETTER Z character (indicating the - time zone is UTC)</li> + <ul><li>A U+005A LATIN CAPITAL LETTER Z character, allowed only if + 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> + HYPHEN-MINUS (-) character, representing the sign of the + timezone offset</li> - <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a> (representing the hours component of the timezone offset)</li> + <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, + representing the hours component <var title="">hour</var> of + the timezone offset, in the range 0 ≤ <var title="">hour</var> ≤ 23</li> - <li>A U+003A COLON character (:).</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 of the timezone offset)</li> + <li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>, + representing the minutes component <var title="">minute</var> + of the timezone offset, in the range 0 ≤ <var title="">minute</var> ≤ 59</li> </ol></li> </ul></li> - </ol><p>The aforementioned constraints are:<ul><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><div class=example> + </ol><p class=note>This format allows for time zone offsets from -23:59 + to +23:59. In practice, however, the range of actual time zones is + -12:00 to +14:00, and the minutes component of actual time zones is + always either 00, 30, or 45.<div class=example> <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> @@ -2654,9 +2677,7 @@ <li><p>Return <var title="">time</var> and <var title="">timezone</var>.</li> - </ol><h5 id=months><span class=secno>2.4.4.5 </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 - beyond a year and a month. <a href=#references>[GREGORIAN]</a><p class=XXX>... <dfn id=valid-month-string>valid month string</dfn><p class=XXX>... rules to <dfn id=parse-a-month-string>parse a month string</dfn><h5 id=weeks><span class=secno>2.4.4.6 </span>Weeks</h5><p>A <dfn id=concept-week title=concept-week>week</dfn> consists of a specific + </ol><h5 id=weeks><span class=secno>2.4.4.6 </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 beyond a year and a week. <a href=#references>[GREGORIAN]</a></p><!-- XXX ISO week information --><p class=XXX>... <dfn id=valid-week-string>valid week string</dfn><p class=XXX>... rules to <dfn id=parse-a-week-string>parse a week string</dfn><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
Received on Thursday, 30 October 2008 01:44:41 UTC