summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qtimezoneprivate_p.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-09-06 17:32:12 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-09-16 17:06:28 +0200
commitb26ac46c5956e716821e64f291749be110731f16 (patch)
tree024bf120cb1e98733598f52541455687e7a4aa3e /src/corelib/time/qtimezoneprivate_p.h
parent1f60e587e724d235adbf067bbbed39475c91f27d (diff)
Add support for UTC[+-]\d+(:\d+){,2} time zone IDs
We presently only support the UTC-based offset timezones that are listed in the CLDR; and it doesn't make sense to list more than these in the list of available zones. However, if someone sets their TZ environment variable to a conformant UTC-offset string, we should make sense of it even if CLDR doesn't mention it. Only do so as final fall-back, as backends may handle the givne name better (some such IDs appear in the windows-compatibility list, for example). Added tests for the new UTC-offset time-zone names. Removed one test that relied on them not being supported. [ChangeLog][QtCore][QTimeZone] The constructor can now handle general UTC-offset zone names. The reported id() of such a zone shall be in canonical form, so might not match the ID passed to the constructor. Fixes: QTBUG-77738 Change-Id: I9a0aa68281a345c4717915c8a8fbc2978490d0aa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/time/qtimezoneprivate_p.h')
-rw-r--r--src/corelib/time/qtimezoneprivate_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/time/qtimezoneprivate_p.h b/src/corelib/time/qtimezoneprivate_p.h
index 5f6491ef81..a57f61f381 100644
--- a/src/corelib/time/qtimezoneprivate_p.h
+++ b/src/corelib/time/qtimezoneprivate_p.h
@@ -188,6 +188,9 @@ public:
QUtcTimeZonePrivate(const QUtcTimeZonePrivate &other);
virtual ~QUtcTimeZonePrivate();
+ // Fall-back for UTC[+-]\d+(:\d+){,2} IDs.
+ static qint64 offsetFromUtcString(const QByteArray &id);
+
QUtcTimeZonePrivate *clone() const override;
Data data(qint64 forMSecsSinceEpoch) const override;