Merge pull request #25842 from marcelofg55/windows_timezone

Fix get_time_zone_info returning inverted bias on Windows/UWP
This commit is contained in:
Rémi Verschelde 2019-02-13 14:28:11 +01:00 committed by GitHub
commit bc9c1e899e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -579,7 +579,9 @@ OS::TimeZoneInfo OS_UWP::get_time_zone_info() const {
ret.name = info.StandardName;
}
ret.bias = info.Bias;
// Bias value returned by GetTimeZoneInformation is inverted of what we expect
// For example on GMT-3 GetTimeZoneInformation return a Bias of 180, so invert the value to get -180
ret.bias = -info.Bias;
return ret;
}

View file

@ -2137,7 +2137,9 @@ OS::TimeZoneInfo OS_Windows::get_time_zone_info() const {
ret.name = info.StandardName;
}
ret.bias = info.Bias;
// Bias value returned by GetTimeZoneInformation is inverted of what we expect
// For example on GMT-3 GetTimeZoneInformation return a Bias of 180, so invert the value to get -180
ret.bias = -info.Bias;
return ret;
}