1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

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.
This commit is contained in:
est31
2015-06-06 05:35:38 +02:00
parent 803069886e
commit c5338fd6c4
8 changed files with 119 additions and 2 deletions

View File

@@ -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;