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

Side by Side Diff: src/animator/SkTime.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 unified diff | Download patch
« no previous file with comments | « include/core/SkTime.h ('k') | src/core/SkTime.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7
8 #include "SkTime.h"
9
10 #ifdef SK_BUILD_FOR_WIN
11
12 #ifdef SK_DEBUG
13 SkMSec gForceTickCount = (SkMSec) -1;
14 #endif
15
16 void SkTime::GetDateTime(DateTime* t) {
17 if (t) {
18 SYSTEMTIME syst;
19
20 ::GetLocalTime(&syst);
21 t->fYear = SkToU16(syst.wYear);
22 t->fMonth = SkToU8(syst.wMonth);
23 t->fDayOfWeek = SkToU8(syst.wDayOfWeek);
24 t->fDay = SkToU8(syst.wDay);
25 t->fHour = SkToU8(syst.wHour);
26 t->fMinute = SkToU8(syst.wMinute);
27 t->fSecond = SkToU8(syst.wSecond);
28 }
29 }
30
31 #elif defined(xSK_BUILD_FOR_MAC)
32
33 #include <time.h>
34
35 void SkTime::GetDateTime(DateTime* t) {
36 if (t) {
37 tm syst;
38 time_t tm;
39
40 time(&tm);
41 localtime_r(&tm, &syst);
42 t->fYear = SkToU16(syst.tm_year);
43 t->fMonth = SkToU8(syst.tm_mon + 1);
44 t->fDayOfWeek = SkToU8(syst.tm_wday);
45 t->fDay = SkToU8(syst.tm_mday);
46 t->fHour = SkToU8(syst.tm_hour);
47 t->fMinute = SkToU8(syst.tm_min);
48 t->fSecond = SkToU8(syst.tm_sec);
49 }
50 }
51
52 #endif
OLDNEW
« no previous file with comments | « include/core/SkTime.h ('k') | src/core/SkTime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698