From 7c33c644d399e7d547ccf9f779197208d07bca84 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 21 Nov 2016 18:17:07 +0100 Subject: Fix QDateTime::toString(Qt::ISODate)'s handling of Qt::TimeZone When the time is specified relative to a zone, the ISO date produced lacked its offset suffix; all zones were treated as if they were local time. Handle zone as for an offset from UTC and ensure we do set the date-time objects's offset from UTC when it's zone-based. Change-Id: I7c9896bb8ec0a9d89df14a6e94b005174ab9e943 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib/tools/qdatetime_p.h') diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h index a217990c8d..b8f6736ac4 100644 --- a/src/corelib/tools/qdatetime_p.h +++ b/src/corelib/tools/qdatetime_p.h @@ -136,6 +136,9 @@ public: static qint64 zoneMSecsToEpochMSecs(qint64 msecs, const QTimeZone &zone, DaylightStatus hint = UnknownDaylightTime, QDate *localDate = 0, QTime *localTime = 0); + + // Inlined for its one caller in qdatetime.cpp + inline void setUtcOffsetByTZ(qint64 atMSecsSinceEpoch); #endif // timezone static inline qint64 minJd() { return QDate::minJd(); } -- cgit v1.2.3