Index: src/ports/SkTime_win.cpp |
diff --git a/src/ports/SkTime_win.cpp b/src/ports/SkTime_win.cpp |
index bc0f8f008474bcfef45280d417863891cfc39eb8..19f4695a86bc498c76cb1d81d26e69e63ea70348 100644 |
--- a/src/ports/SkTime_win.cpp |
+++ b/src/ports/SkTime_win.cpp |
@@ -14,8 +14,22 @@ void SkTime::GetDateTime(DateTime* dt) |
if (dt) |
{ |
SYSTEMTIME st; |
- GetSystemTime(&st); |
- |
+ TIME_ZONE_INFORMATION timeZoneInfo; |
+ int tz_bias; |
+ GetLocalTime(&st); |
+ // https://gist.github.com/wrl/8924636 |
+ switch (GetTimeZoneInformation(&timeZoneInfo)) { |
+ case TIME_ZONE_ID_STANDARD: |
+ tz_bias = -timeZoneInfo.Bias - timeZoneInfo.StandardBias; |
+ break; |
+ case TIME_ZONE_ID_DAYLIGHT: |
+ tz_bias = -timeZoneInfo.Bias - timeZoneInfo.DaylightBias; |
+ break; |
+ default: |
+ tz_bias = -timeZoneInfo.Bias; |
+ break; |
+ } |
+ dt->fTimeZoneMinutes = SkToS16(tz_bias); |
dt->fYear = st.wYear; |
dt->fMonth = SkToU8(st.wMonth); |
dt->fDayOfWeek = SkToU8(st.wDayOfWeek); |