From 536b918ecaed0b8a04ca2b7c0884eea12ddb6931 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 16 May 2017 16:43:42 +0200 Subject: 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 --- src/corelib/tools/qtimezone.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/corelib/tools/qtimezone.h') 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, -- cgit v1.2.3