diff options
| author | est31 <MTest31@outlook.com> | 2015-06-06 03:40:56 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2015-06-06 05:55:28 +0200 |
| commit | 803069886ebca492c0d5f47133ccf7833c716e5a (patch) | |
| tree | 711fbad4ba24fe58c7284e177a16bea6adc9eef5 /core/bind/core_bind.cpp | |
| parent | 26ea12a873d0e7c1467ee6b52c9559dc5f456bd3 (diff) | |
| download | redot-engine-803069886ebca492c0d5f47133ccf7833c716e5a.tar.gz | |
Add utc param to get_time and get_date methods
If utc == false, we return the local time, like before.
Otherwise, we return UTC time.
utc defaults to false to not break behaviour.
Diffstat (limited to 'core/bind/core_bind.cpp')
| -rw-r--r-- | core/bind/core_bind.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 128bc94989..700856ab6f 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -457,9 +457,9 @@ void _OS::set_icon(const Image& p_icon) { OS::get_singleton()->set_icon(p_icon); } -Dictionary _OS::get_date() const { +Dictionary _OS::get_date(bool utc) const { - OS::Date date = OS::get_singleton()->get_date(); + OS::Date date = OS::get_singleton()->get_date(utc); Dictionary dated; dated["year"]=date.year; dated["month"]=date.month; @@ -470,9 +470,9 @@ Dictionary _OS::get_date() const { } -Dictionary _OS::get_time() const { +Dictionary _OS::get_time(bool utc) const { - OS::Time time = OS::get_singleton()->get_time(); + OS::Time time = OS::get_singleton()->get_time(utc); Dictionary timed; timed["hour"]=time.hour; timed["minute"]=time.min; @@ -774,8 +774,8 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_cmdline_args"),&_OS::get_cmdline_args); ObjectTypeDB::bind_method(_MD("get_main_loop"),&_OS::get_main_loop); - ObjectTypeDB::bind_method(_MD("get_date"),&_OS::get_date); - ObjectTypeDB::bind_method(_MD("get_time"),&_OS::get_time); + 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_unix_time"),&_OS::get_unix_time); ObjectTypeDB::bind_method(_MD("set_icon"),&_OS::set_icon); |
