summaryrefslogtreecommitdiffstats
path: root/core/bind/core_bind.cpp
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 /core/bind/core_bind.cpp
parent803069886ebca492c0d5f47133ccf7833c716e5a (diff)
downloadredot-engine-c5338fd6c40d08472b680809cfa04d47826bdcf5.tar.gz
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 'core/bind/core_bind.cpp')
-rw-r--r--core/bind/core_bind.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 700856ab6f..26b1dac6f1 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -480,6 +480,15 @@ Dictionary _OS::get_time(bool utc) const {
return timed;
}
+
+Dictionary _OS::get_time_zone_info() const {
+ OS::TimeZoneInfo info = OS::get_singleton()->get_time_zone_info();
+ Dictionary infod;
+ infod["bias"] = info.bias;
+ infod["name"] = info.name;
+ return infod;
+}
+
uint64_t _OS::get_unix_time() const {
return OS::get_singleton()->get_unix_time();
@@ -776,6 +785,7 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_date","utc"),&_OS::get_date,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false));
+ ObjectTypeDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info);
ObjectTypeDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time);
ObjectTypeDB::bind_method(_MD("set_icon"),&_OS::set_icon);