diff options
author | halcanary <halcanary@google.com> | 2015-05-01 07:06:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-01 07:06:23 -0700 |
commit | 0b9d4118ba4f3f1190c063492894e324c63e8fd8 (patch) | |
tree | d7b7faaa33d11420c02097b1653d08871f845f98 /tests/Time.cpp | |
parent | d309e7aa0efa2d5dd7e7b1af97026fcd3a047e98 (diff) |
SkTime: return timezone information; format in ISO-8601
Motivation: PDF/A metadata will need the creation date embedded in it.
Also, GetDateTime returns local time in Win32. This now behaves the
same as on Unix systems.
BUG=skia:3110
Review URL: https://codereview.chromium.org/1109593002
Diffstat (limited to 'tests/Time.cpp')
-rw-r--r-- | tests/Time.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/Time.cpp b/tests/Time.cpp index 0139654e19..60dcd5527c 100644 --- a/tests/Time.cpp +++ b/tests/Time.cpp @@ -41,4 +41,16 @@ DEF_TEST(Time_GetDateTime, r) { REPORTER_ASSERT(r, dateTime.fMinute <= 59); REPORTER_ASSERT(r, dateTime.fSecond <= 60); // leap seconds are 23:59:60 + + // The westernmost timezone is -12:00. + // The easternmost timezone is +14:00. + REPORTER_ASSERT(r, abs(SkToInt(dateTime.fTimeZoneMinutes)) <= 14 * 60); + + SkString timeStamp; + dateTime.toISO8601(&timeStamp); + REPORTER_ASSERT(r, timeStamp.size() > 0); + if (r->verbose()) { // `dm --veryVerbose` + SkDebugf("\nCurrent Time (ISO-8601 format): \"%s\"\n", + timeStamp.c_str()); + } } |