diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2013-09-16 11:55:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 14:58:27 +0200 |
commit | 438912f27350cfe5f63f8abc68f4fc99614ee7c5 (patch) | |
tree | d03681ece7a2e4fbfec4a71f5ec0e9d1ac2b7052 /src/corelib/tools/qdatetime.cpp | |
parent | 89294d04e2e417289198762211bd5f789c3eefc6 (diff) |
Revert 15da0a5af20fe6771bcb94ef8d46edbd5c8fb64c.
It apparently breaks users' applications.
Task-number: QTBUG-33487
Change-Id: Iaeceb3a02b5c7b9ab839c14693aaffcdf9394bc6
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/corelib/tools/qdatetime.cpp')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index dac1455d5c..ff96fbf811 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1583,12 +1583,12 @@ int QTime::msec() const Returns the time as a string. The \a format parameter determines the format of the string. - If \a format is Qt::TextDate, the string format is HH:MM:SS.zzz; - e.g. 1 second before midnight would be "23:59:59.000". + If \a format is Qt::TextDate, the string format is HH:MM:SS; + e.g. 1 second before midnight would be "23:59:59". If \a format is Qt::ISODate, the string format corresponds to the - ISO 8601 extended specification (with decimal fractions) for - representations of dates; also HH:MM:SS.zzz. + ISO 8601 extended specification for representations of dates, + which is also HH:MM:SS. If the \a format is Qt::SystemLocaleShortDate or Qt::SystemLocaleLongDate, the string format depends on the locale @@ -1636,10 +1636,9 @@ QString QTime::toString(Qt::DateFormat format) const case Qt::ISODate: case Qt::TextDate: default: - return QString::fromUtf8("%1:%2:%3.%4").arg(hour(), 2, 10, QLatin1Char('0')) - .arg(minute(), 2, 10, QLatin1Char('0')) - .arg(second(), 2, 10, QLatin1Char('0')) - .arg(msec(), 3, 10, QLatin1Char('0')); + return QString::fromUtf8("%1:%2:%3").arg(hour(), 2, 10, QLatin1Char('0')) + .arg(minute(), 2, 10, QLatin1Char('0')) + .arg(second(), 2, 10, QLatin1Char('0')); } } @@ -2729,15 +2728,15 @@ void QDateTime::setTime_t(uint secsSince1Jan1970UTC) and QTime::toString() are used to generate the string, so the day and month names will be localized names using the system locale, i.e. QLocale::system(). An example of this formatting is - "Wed May 20 03:40:13.456 1998". + "Wed May 20 03:40:13 1998". If the \a format is Qt::ISODate, the string format corresponds - to the ISO 8601 extended specification (with decimal fractions) for - representations of dates and times, taking the form - YYYY-MM-DDTHH:MM:SS.zzz[Z|[+|-]HH:MM], depending on the timeSpec() - of the QDateTime. If the timeSpec() is Qt::UTC, Z will be appended - to the string; if the timeSpec() is Qt::OffsetFromUTC, the offset - in hours and minutes from UTC will be appended to the string. + to the ISO 8601 extended specification for representations of + dates and times, taking the form YYYY-MM-DDTHH:MM:SS[Z|[+|-]HH:MM], + depending on the timeSpec() of the QDateTime. If the timeSpec() + is Qt::UTC, Z will be appended to the string; if the timeSpec() is + Qt::OffsetFromUTC, the offset in hours and minutes from UTC will + be appended to the string. If the \a format is Qt::SystemLocaleShortDate or Qt::SystemLocaleLongDate, the string format depends on the locale |