Index: src/ports/SkTime_Unix.cpp |
diff --git a/src/ports/SkTime_Unix.cpp b/src/ports/SkTime_Unix.cpp |
index 6e305a16f6eb8073e393e1d5d8629826035daaab..54acba5a23d285dcd8cfa593995019b4f759572c 100644 |
--- a/src/ports/SkTime_Unix.cpp |
+++ b/src/ports/SkTime_Unix.cpp |
@@ -16,10 +16,13 @@ void SkTime::GetDateTime(DateTime* dt) |
{ |
if (dt) |
{ |
+ tzset(); // initialize timezone variable; |
time_t m_time; |
time(&m_time); |
struct tm* tstruct; |
tstruct = localtime(&m_time); |
+ int offset = tstruct->tm_isdst == 1 ? 60 : 0; |
+ |
// http://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html |
dt->fYear = tstruct->tm_year + 1900; |
dt->fMonth = SkToU8(tstruct->tm_mon + 1); |
@@ -28,6 +31,7 @@ void SkTime::GetDateTime(DateTime* dt) |
dt->fHour = SkToU8(tstruct->tm_hour); |
dt->fMinute = SkToU8(tstruct->tm_min); |
dt->fSecond = SkToU8(tstruct->tm_sec); |
+ dt->fTimeZoneMinutes = SkToS16(offset - timezone / 60); |
} |
} |