path: root/src/corelib/tools/qdatetime_p.h
diff options
authorEdward Welbourne <>2016-11-21 18:17:07 +0100
committerEdward Welbourne <>2016-12-14 16:40:42 +0000
commit7c33c644d399e7d547ccf9f779197208d07bca84 (patch)
treede04e8d639b246c57667d6b7b6a259e7044c8e18 /src/corelib/tools/qdatetime_p.h
parent9d8db91ada0ab340ae781862f567c9b104e83c63 (diff)
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 <>
Diffstat (limited to 'src/corelib/tools/qdatetime_p.h')
1 files changed, 3 insertions, 0 deletions
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(); }