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

Side by Side Diff: src/core/SkTime.cpp

Issue 1109593002: SkTime: return timezone information (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: reorder assignment Created 5 years, 7 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/ports/SkTime_Unix.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkString.h"
9 #include "SkTime.h"
10
11 void SkTime::DateTime::toISO8601(SkString* dst) const {
12 if (dst) {
13 int timeZoneMinutes = SkToInt(fTimeZoneMinutes);
14 char timezoneSign = timeZoneMinutes >= 0 ? '+' : '-';
15 int timeZoneHours = abs(timeZoneMinutes) / 60;
16 timeZoneMinutes = abs(timeZoneMinutes) % 60;
17 dst->printf("%04u-%02u-%02uT%02u:%02u:%02u%c%02d:%02d",
18 static_cast<unsigned>(fYear), static_cast<unsigned>(fMonth),
19 static_cast<unsigned>(fDay), static_cast<unsigned>(fHour),
20 static_cast<unsigned>(fMinute),
21 static_cast<unsigned>(fSecond), timezoneSign, timeZoneHours,
22 timeZoneMinutes);
23 }
24 }
OLDNEW
« no previous file with comments | « include/core/SkTime.h ('k') | src/ports/SkTime_Unix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698