DefaultExternalFormat scans combined dates and times agreeing with the following syntax (here in pseudo-code) :
The scanner does not interpret numbers itself and from its point of view, hour 42 and minute 88 are fine. The {@link DefaultExternalFormat#scan(String) scan(String)} method returns a TimeParts object, but there is noguarantee that the date and time components have already been validated when the method returns. The responsibility for validating numbers falls to {@link TimeParts#asRawIndex(Resolution)}.date-time := date-time-basic|date-time-extended date-time-basic := date-basic[Ttime-basic[Z|(+|-time-basic)]] date-basic := yyyy[mm[dd]] time-basic := hh[mm[ss[,|.u{1,6}]]] date-time-extended := date-extended[T| time-extended[Z|(+|-time-extended)]] date-extended := (+y+)?yyyy[-mm[-dd]] time-extended := hh[:mm[:ss[,|.u{1-6}]]]Meta syntax: meta elements in italic; literals underlined; a single lowercase letter represents a single digit; * means zero or more; + means one or more; ? means zero or one; {n,m} means n to m times; optional elements in square brackets; alternatives separated by vertical bar; parentheses for grouping.The fields represented by lowercase letters are year (y), month (m), day (d), hour (h), minute (m), second (s), fraction of a second (u).
For the validation to succeed, the components must have the following values:
There are some differences between the calendar date and time representation supported here and ISO 8601:2004:
@author Jean-Paul Vetterli
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|