diff --git a/index b/index index d74435d5bee..529cabcce8d 100644 --- a/index +++ b/index @@ -225,12 +225,12 @@
The digits 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.
-A global date and time - 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. [GREGORIAN]
+A date consists of a specific + Gregorian date with no timezone information, consisting of a year, a + month, and a day. [GREGORIAN]
-A string is a valid global date and time string 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 +
A string is a valid date string 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:
-The aforementioned constraints are:
+ +The rules to parse a date string 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.
+ +Let input be the string being + parsed.
Let position be a pointer into input, initially pointing at the start of the + string.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
+ +If position is not beyond the + end of input, then fail.
Let date be the date with year year, month month, and day day.
Return date.
The rules to parse a date component, given an input string and a position, 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.
+ +Collect a sequence of characters in the range + U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected + 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 year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, + then fail. Otherwise, move position forwards + one character.
Collect a sequence of characters 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 month.
Let maxday be the number of days + in month month of year year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, + then fail. Otherwise, move position forwards + one character.
Collect a sequence of characters 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 day.
If day is not a number in the range + 1 ≤ month ≤ maxday, then fail.
Return year, month, + and day.
A time consists of a specific + time with no timezone information, consisting of an hour, a minute, + a second, and a fraction of a second.
+ +A string is a valid time string 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:
+ +The aforementioned constraints are:
+ +The rules to parse a time string 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.
+ +Let input be the string being + parsed.
Let position be a pointer into input, initially pointing at the start of the + string.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
+ +If position is not beyond the + end of input, then fail.
Let time be the time with hour hour, minute minute, and second + second.
Return time.
The rules to parse a time component, given an input string and a position, are + as follows. This will either return an hour, a minute, and a second, + or nothing. If at any point the algorithm says that it "fails", this + means that it is aborted at that point and returns nothing.
+ +Collect a sequence of characters 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 hour.
If position is beyond the end of input or if the character at position is not a U+003A COLON character, then + fail. Otherwise, move position forwards one + character.
Collect a sequence of characters 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 minute.
Let second be a string with the value + "0".
If position is not beyond the end of + input and the character at position is a U+003A COLON, then run these + substeps:
+ +Advance position to the next character + in input.
If position is beyond the end of input, or at the last character in input, or if the next two characters in + input starting at position are not two characters both in the range + U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then + fail.
Collect a sequence of characters that are + either characters in the range U+0030 DIGIT ZERO (0) to U+0039 + DIGIT NINE (9) or U+002E FULL STOP characters. If the collected + sequence has more than one U+002E FULL STOP characters, or if the + last character in the sequence is a U+002E FULL STOP character, + then fail. Otherwise, let the collected string be second instead of its previous value.
Interpret second as a base-ten number + (possibly with a fractional part). Let second + be that number instead of the string version.
Return hour, minute, + and second.
A local date and time + 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. [GREGORIAN]
+ +A string is a valid local date and time string if it + has the components in the following list, in the given order:
+ +The rules to parse a local date and time string are as + follows. This will either return a date and 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.
+ +Let input be the string being + parsed.
Let position be a pointer into input, initially pointing at the start of the + string.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
+ +If position is beyond the end of input or if the character at position is not a U+0054 LATIN CAPITAL LETTER T + character then fail. Otherwise, move position + forwards one character.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
+ +If position is not beyond the + end of input, then fail.
Let date be the date with year year, month month, and day day.
Let time be the time with hour hour, minute minute, and second + second.
Return date and time.
A global date and time + 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. [GREGORIAN]
+ + + +A string is a valid global date and time string 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:
+ +The aforementioned constraints are:
-The digits must be characters in the range U+0030 DIGIT ZERO to - U+0039 DIGIT NINE, used to express numbers in base ten.
- -The following are some examples of dates written as valid global date and time strings.
@@ -2851,104 +3080,13 @@Let position be a pointer into input, initially pointing at the start of the string.
Collect a sequence of characters in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected - 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 year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, - then fail. Otherwise, move position forwards - one character.
Collect a sequence of characters 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 month.
Let maxday be the number of days - in month month of year year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, - then fail. Otherwise, move position forwards - one character.
Collect a sequence of characters 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 day.
If day is not a number in the range - 1 ≤ month ≤ maxday, then fail.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
If position is beyond the end of input or if the character at position is not a U+0054 LATIN CAPITAL LETTER T character then fail. Otherwise, move position forwards one character.
Collect a sequence of characters 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 hour.
If position is beyond the end of input or if the character at position is not a U+003A COLON character, then - fail. Otherwise, move position forwards one - character.
Collect a sequence of characters 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 minute.
Let second be a string with the value - "0".
If position is beyond the end of input, then fail.
If the character at position is a U+003A - COLON, then run these substeps:
- -Advance position to the next character - in input.
If position is beyond the end of input, or at the last character in input, or if the next two characters in - input starting at position are not two characters both in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then - fail.
Collect a sequence of characters that are - either characters in the range U+0030 DIGIT ZERO (0) to U+0039 - DIGIT NINE (9) or U+002E FULL STOP characters. If the collected - sequence has more than one U+002E FULL STOP characters, or if the - last character in the sequence is a U+002E FULL STOP character, - then fail. Otherwise, let the collected string be second instead of its previous value.
Interpret second as a base-ten number - (possibly with a fractional part). Let second - be that number instead of the string version.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
If position is beyond the end of input, then fail.
Return time and timezone.
A local date and time - consists of a specific Gregorian date with no timezone information, - consisting of a year, a month, a day, an hour, a minute, a second, - and a fraction of a second. [GREGORIAN]
- -... valid local date and time string
- -... rules to parse a local date and time - string
- - -A date consists of a specific - Gregorian date with no timezone information, consisting of a year, a - month, and a day. [GREGORIAN]
- -... valid date string
- -... rules to parse a date string
- - -A month consists of a specific Gregorian date with no timezone information and no date information @@ -3054,7 +3168,7 @@
... rules to parse a month string
-A week consists of a specific Gregorian date with no timezone information and no date information @@ -3067,17 +3181,6 @@
... rules to parse a week string
-A time consists of a specific - time with no timezone information, consisting of an hour, a minute, - a second, and a fraction of a second.
- -... valid time string
- -... rules to parse a time string
- -The digits 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.
-A global date and time - 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. [GREGORIAN]
+A date consists of a specific + Gregorian date with no timezone information, consisting of a year, a + month, and a day. [GREGORIAN]
-A string is a valid global date and time string 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 +
A string is a valid date string 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:
The aforementioned constraints are:
+ +The rules to parse a date string 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.
+ +Let input be the string being + parsed.
Let position be a pointer into input, initially pointing at the start of the + string.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
+ +If position is not beyond the + end of input, then fail.
Let date be the date with year year, month month, and day day.
Return date.
The rules to parse a date component, given an input string and a position, 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.
+ +Collect a sequence of characters in the range + U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected + 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 year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, + then fail. Otherwise, move position forwards + one character.
Collect a sequence of characters 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 month.
Let maxday be the number of days + in month month of year year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, + then fail. Otherwise, move position forwards + one character.
Collect a sequence of characters 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 day.
If day is not a number in the range + 1 ≤ month ≤ maxday, then fail.
Return year, month, + and day.
A time consists of a specific + time with no timezone information, consisting of an hour, a minute, + a second, and a fraction of a second.
+ +A string is a valid time string 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:
+ +The aforementioned constraints are:
+ +The rules to parse a time string 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.
+ +Let input be the string being + parsed.
Let position be a pointer into input, initially pointing at the start of the + string.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
+ +If position is not beyond the + end of input, then fail.
Let time be the time with hour hour, minute minute, and second + second.
Return time.
The rules to parse a time component, given an input string and a position, are + as follows. This will either return an hour, a minute, and a second, + or nothing. If at any point the algorithm says that it "fails", this + means that it is aborted at that point and returns nothing.
+ +Collect a sequence of characters 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 hour.
If position is beyond the end of input or if the character at position is not a U+003A COLON character, then + fail. Otherwise, move position forwards one + character.
Collect a sequence of characters 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 minute.
Let second be a string with the value + "0".
If position is not beyond the end of + input and the character at position is a U+003A COLON, then run these + substeps:
+ +Advance position to the next character + in input.
If position is beyond the end of input, or at the last character in input, or if the next two characters in + input starting at position are not two characters both in the range + U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then + fail.
Collect a sequence of characters that are + either characters in the range U+0030 DIGIT ZERO (0) to U+0039 + DIGIT NINE (9) or U+002E FULL STOP characters. If the collected + sequence has more than one U+002E FULL STOP characters, or if the + last character in the sequence is a U+002E FULL STOP character, + then fail. Otherwise, let the collected string be second instead of its previous value.
Interpret second as a base-ten number + (possibly with a fractional part). Let second + be that number instead of the string version.
Return hour, minute, + and second.
A local date and time + 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. [GREGORIAN]
+ +A string is a valid local date and time string if it + has the components in the following list, in the given order:
+ +The rules to parse a local date and time string are as + follows. This will either return a date and 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.
+ +Let input be the string being + parsed.
Let position be a pointer into input, initially pointing at the start of the + string.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
+ +If position is beyond the end of input or if the character at position is not a U+0054 LATIN CAPITAL LETTER T + character then fail. Otherwise, move position + forwards one character.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
+ +If position is not beyond the + end of input, then fail.
Let date be the date with year year, month month, and day day.
Let time be the time with hour hour, minute minute, and second + second.
Return date and time.
A global date and time + 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. [GREGORIAN]
+ + + +A string is a valid global date and time string 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:
+ +The digits must be characters in the range U+0030 DIGIT ZERO to - U+0039 DIGIT NINE, used to express numbers in base ten.
-The following are some examples of dates written as input, initially pointing at the start of the string.
-Collect a sequence of characters in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected - 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 year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, - then fail. Otherwise, move position forwards - one character.
Collect a sequence of characters 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 month.
Let maxday be the number of days - in month month of year year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, - then fail. Otherwise, move position forwards - one character.
Collect a sequence of characters 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 day.
If day is not a number in the range - 1 ≤ month ≤ maxday, then fail.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
If position is beyond the end of input or if the character at position forwards one character.
Collect a sequence of characters 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 hour.
If position is beyond the end of input or if the character at position is not a U+003A COLON character, then - fail. Otherwise, move position forwards one - character.
Collect a sequence of characters 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 minute.
Let second be a string with the value - "0".
If position is beyond the end of input, then fail.
If the character at position is a U+003A - COLON, then run these substeps:
- -Advance position to the next character - in input.
If position is beyond the end of input, or at the last character in input, or if the next two characters in - input starting at position are not two characters both in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then - fail.
Collect a sequence of characters that are - either characters in the range U+0030 DIGIT ZERO (0) to U+0039 - DIGIT NINE (9) or U+002E FULL STOP characters. If the collected - sequence has more than one U+002E FULL STOP characters, or if the - last character in the sequence is a U+002E FULL STOP character, - then fail. Otherwise, let the collected string be second instead of its previous value.
Interpret second as a base-ten number - (possibly with a fractional part). Let second - be that number instead of the string version.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
If position is beyond the end of input, then fail.
A local date and time - consists of a specific Gregorian date with no timezone information, - consisting of a year, a month, a day, an hour, a minute, a second, - and a fraction of a second. [GREGORIAN]
- -... valid local date and time string
- -... rules to parse a local date and time - string
- - -A date consists of a specific - Gregorian date with no timezone information, consisting of a year, a - month, and a day. [GREGORIAN]
- -... valid date string
- -... rules to parse a date string
-... rules to parse a week string
-A time consists of a specific - time with no timezone information, consisting of an hour, a minute, - a second, and a fraction of a second.
- -... valid time string
- -... rules to parse a time string
- -