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>
This commit is contained in:
parent
baf5eed1ef
commit
ac109e1316
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user