Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.6, 5.7, 5.8, 5.9
-
None
-
13
-
837781db52b59012fdebb357ccb3abbd2f9bf2f5
Description
QTime uses QString::asprintf("%02d:%02d:%02d", hour(), minute(), second()); when converting to a string for Qt::ISODate, but ISO 8601 includes possible milliseconds.
This means that parsing a string into a QTime and outputting it again later will truncate milliseconds, potentially making two distinct events on the wire have the same timestamp when in reality they didn't.
HH:mm:ss.zzz -> fromString(Qt::ISODate) -> QTime(HH, mm, ss, zzz) -> toString(Qt::ISODate) -> HH:mm:ss
Workaround for 5.8 is to add a new enum Qt::ISODateWithMs that fixes the behaviour, without backwards-comparability issues.
Attachments
Issue Links
- relates to
-
QTBUG-85700 Chase up deprecations and ### Qt6 comments throughout src/corelib/
- Closed
-
QTBUG-86133 Add support for hour-only forms in Q(Date)?Time::fromString(Qt::ISODate)
- Closed
For Gerrit Dashboard: QTBUG-56552 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
309914,4 | Change ISODate format to include milliseconds | dev | qt/qtbase | Status: DEFERRED | -1 | 0 |
333836,5 | Rework tst_QDateTime::toString_isoDate() to eliminate an XFAIL | dev | qt/qtbase | Status: MERGED | +2 | 0 |
334281,2 | Rework tst_QDateTime::toString_isoDate() to eliminate an XFAIL | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 |
334282,2 | Rework tst_QDateTime::toString_isoDate() to eliminate an XFAIL | 6.0 | qt/qtbase | Status: MERGED | +2 | 0 |
334388,5 | Rework tst_QDateTime::toString_isoDate() to eliminate an XFAIL | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |