summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Seither <post@tiwoc.de>2014-02-04 12:39:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-08 21:28:45 +0200
commitac109e1316750175100cafc7f486b0c8ff03f716 (patch)
tree67d02a2b3365c1335d1259e21d9b90f06457dea6
parentbaf5eed1ef5a71cdcf4ee56cb3e9c9eaa45ea60b (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.cpp2
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