You've already forked godot
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user