summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qtimezone.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-01-14 16:27:31 -0800
committerThiago Macieira <thiago.macieira@intel.com>2015-01-16 03:12:13 +0100
commit514af281e39cb54daf667305b3f98e0782dbe689 (patch)
tree4c88dab593cf7b89bec609006ed675f8dd86eeab /src/corelib/tools/qtimezone.cpp
parent3d051d41a3034f253da94ce7eef4af579089cb64 (diff)
Add QTimeZone::{systemTimeZone,utc}
[ChangeLog][QtCore][QTimeZone] Added methods systemTimeZone() and utc() that return QTimeZone objects for the system time zone and for UTC, respectively. Change-Id: Ic5d393bfd36e48a193fcffff13b96821bb8514b9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/tools/qtimezone.cpp')
-rw-r--r--src/corelib/tools/qtimezone.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index fb5af2bf4a..30c4c60167 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -789,6 +789,29 @@ QByteArray QTimeZone::systemTimeZoneId()
}
/*!
+ \since 5.5
+ Returns a QTimeZone object that refers to the local system time, as
+ specified by systemTimeZoneId().
+
+ \sa utc()
+*/
+QTimeZone QTimeZone::systemTimeZone()
+{
+ return QTimeZone(QTimeZone::systemTimeZoneId());
+}
+
+/*!
+ \since 5.5
+ Returns a QTimeZone object that refers to UTC (Universal Time Coordinated).
+
+ \sa systemTimeZone()
+*/
+QTimeZone QTimeZone::utc()
+{
+ return QTimeZone(QTimeZonePrivate::utcQByteArray());
+}
+
+/*!
Returns \c true if a given time zone \a ianaId is available on this system.
\sa availableTimeZoneIds()