diff options
author | Daniel Seither <post@tiwoc.de> | 2014-02-04 12:39:17 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-08 21:28:45 +0200 |
commit | ac109e1316750175100cafc7f486b0c8ff03f716 (patch) | |
tree | 67d02a2b3365c1335d1259e21d9b90f06457dea6 | |
parent | baf5eed1ef5a71cdcf4ee56cb3e9c9eaa45ea60b (diff) |
QDateTime: Fix sign handling in the timezone offset writer
Previously, this produced wrong results, for example -3:30
became -3:-30.
Change-Id: I10efdfb48e5542b917c86b29cf8a99bfc26f7fe0
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 280d516452..801876629c 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -253,7 +253,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset) return result.arg(offset >= 0 ? QLatin1Char('+') : QLatin1Char('-')) .arg(qAbs(offset) / SECS_PER_HOUR, 2, 10, QLatin1Char('0')) - .arg((offset / 60) % 60, 2, 10, QLatin1Char('0')); + .arg((qAbs(offset) / 60) % 60, 2, 10, QLatin1Char('0')); } // Parse offset in [+-]HH[:]MM format |