Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Unified Diff: src/ports/SkTime_Unix.cpp

Issue 1562943002: SkTime: Stop using POSIX entensions to time.h for timezone (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-01-11 (Monday) 17:28:49 EST Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkTime.cpp ('k') | src/ports/SkTime_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkTime_Unix.cpp
diff --git a/src/ports/SkTime_Unix.cpp b/src/ports/SkTime_Unix.cpp
index 1ea3b8fbd0f5a1cb69a8c4906dd161ca507d1ef1..2123a406192fdda23a8734148368ae50c5a2cae7 100644
--- a/src/ports/SkTime_Unix.cpp
+++ b/src/ports/SkTime_Unix.cpp
@@ -5,32 +5,3 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-
-#include "SkTime.h"
-#include "SkTypes.h"
-
-#include <sys/time.h>
-#include <time.h>
-
-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->fTimeZoneMinutes = SkToS16(offset - timezone / 60);
- dt->fYear = tstruct->tm_year + 1900;
- dt->fMonth = SkToU8(tstruct->tm_mon + 1);
- dt->fDayOfWeek = SkToU8(tstruct->tm_wday);
- dt->fDay = SkToU8(tstruct->tm_mday);
- dt->fHour = SkToU8(tstruct->tm_hour);
- dt->fMinute = SkToU8(tstruct->tm_min);
- dt->fSecond = SkToU8(tstruct->tm_sec);
- }
-}
« no previous file with comments | « src/core/SkTime.cpp ('k') | src/ports/SkTime_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698