summaryrefslogtreecommitdiff
path: root/platform/winrt
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-06-06 05:35:38 +0200
committerest31 <MTest31@outlook.com>2015-06-06 05:57:33 +0200
commitc5338fd6c40d08472b680809cfa04d47826bdcf5 (patch)
treed9cbdebd87b97616e0cbd52e46ad6887f01d90e1 /platform/winrt
parent803069886ebca492c0d5f47133ccf7833c716e5a (diff)
Add OS.get_time_zone_info function
The returned dictionary maps "name" to the name of the current time zone, and "bias" to a bias from UTC in minutes.
Diffstat (limited to 'platform/winrt')
-rw-r--r--platform/winrt/os_winrt.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/winrt/os_winrt.cpp b/platform/winrt/os_winrt.cpp
index a84e54ee0e..24037f05d7 100644
--- a/platform/winrt/os_winrt.cpp
+++ b/platform/winrt/os_winrt.cpp
@@ -469,6 +469,22 @@ OS::Time OSWinrt::get_time(bool utc) const {
return time;
}
+OS::TimeZoneInfo OS_Windows::get_time_zone_info() const {
+ TIME_ZONE_INFORMATION info;
+ bool daylight = false;
+ if (GetTimeZoneInformation(info) == TIME_ZONE_ID_DAYLIGHT)
+ daylight = true;
+
+ if (daylight) {
+ ret.name = info.DaylightName;
+ } else {
+ ret.name = info.StandardName;
+ }
+
+ ret.bias = info.Bias;
+ return ret;
+}
+
uint64_t OSWinrt::get_unix_time(bool utc) const {
FILETIME ft;