Details
-
User Story
-
Resolution: Done
-
P3: Somewhat important
-
5.15.0
-
None
-
-
13
-
4e675cb85e81b67f36473914f5822dd6e626ddf0 qtbase/dev
Description
If WikiPedia's page is to be trusted (I have no copy of the ISO spec to verify; ISO charges for specs), the time part of the ISO 8601 format may consist simply of the hour, HH, optionally with a fractional part, after a [,.] separator.
This is not currently supported; see fromIsoTimeString().
Our parsing should probably also support parsing the plain version of the time, with no colon separators, provided there are two, four or six digits (before any fractional-part separator), since conforming implementations of a standard should cope with what other conforming implementations generate.
Also note that QDate::fromString() neglects to treat ISODateWithMs as an alias for ISODate; it clearly should, if only to let generic date/date-time/time code take the same spec without having to worry about which of the three it's forwarding to.
There is also an "ordinal date" format YYYY-DDD (with the dash optional) which we should at least recognise when parsing; and a YYYY-Www with optional -D suffix, e.g. 2020-W34-3, for specifying a date by week-number. This probably deserves to be a separate format type, at least for toString() purposes, although it may make sense to parse all forms equivalently.
Also note that 1BC is +0000 while 2BC is −0001, so the ISO year numbering doesn't match ours.
A thorough study of the spec, together with adapting to all it implies, is in order.
Attachments
Issue Links
- relates to
-
QTBUG-56552 QDateTime/QTime truncates milliseconds when converting to Qt::ISODate string
- Closed