Make QDateTime::fromString()/Time::fromString() adhere to ISO 8601.
authorMitch Curtis <mitch.curtis@nokia.com>
Mon, 18 Jun 2012 13:53:30 +0000 (15:53 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 20 Jun 2012 10:38:32 +0000 (12:38 +0200)
commit86f953a6d40666a3355e76b3ab2c8a2cf5452ec6
tree263c183be7f1dbd8c6ac4eb78515762e4e6c2b75
parent223ed436b58c13843b87ac28be2659ca73ec1272
Make QDateTime::fromString()/Time::fromString() adhere to ISO 8601.

Currently QDateTime::fromString and QTime::fromString do not correctly
handle fractional minutes and, in some cases, fractional seconds.

In the case of reading fractional minutes, it has been decided to
ignore invalid characters outside of the 5 character portion that
we're interested in (see code comments in fromStringImpl() for
info on why we read 5 digits). The motive is that there is a
performance penalty for calling mid to get the portion of surplus
string and also for converting to it to a float. This is also in
line with what QDate does with surplus characters, for example.

Task-number: QTBUG-14418
Task-number: QTBUG-25387
Change-Id: Ib742fe80686aff3c3770b995678cf838fb4e3bb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qdatetime.cpp
tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
tests/auto/corelib/tools/qtime/tst_qtime.cpp