summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qtimezone.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-05-16 16:43:42 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2017-06-13 11:27:57 +0000
commit536b918ecaed0b8a04ca2b7c0884eea12ddb6931 (patch)
treeac3b1cbf853daa45594865142ec2a5c3879a8f62 /src/corelib/tools/qtimezone.h
parent748d87f28f87fd12b5a1e156025a92c32b73ae8e (diff)
QTimeZone: make UTC offset range available for other code to reuse
When QDateTimeParser learns to parse zones, it'll need to know the valid range of offsets. Change-Id: I44cd88a140ebaf6a2b98b0f9a1be0cbc7a35bae4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qtimezone.h')
-rw-r--r--src/corelib/tools/qtimezone.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/tools/qtimezone.h b/src/corelib/tools/qtimezone.h
index bd87139f5b..29d8a4dbe5 100644
--- a/src/corelib/tools/qtimezone.h
+++ b/src/corelib/tools/qtimezone.h
@@ -59,6 +59,14 @@ class QTimeZonePrivate;
class Q_CORE_EXPORT QTimeZone
{
public:
+ // Sane UTC offsets range from -14 to +14 hours:
+ enum {
+ // No known zone > 12 hrs West of Greenwich (Baker Island, USA)
+ MinUtcOffsetSecs = -14 * 3600,
+ // No known zone > 14 hrs East of Greenwich (Kiritimati, Christmas Island, Kiribati)
+ MaxUtcOffsetSecs = +14 * 3600
+ };
+
enum TimeType {
StandardTime = 0,
DaylightTime = 1,