diff options
author | yangguo@chromium.org <yangguo@chromium.org> | 2012-10-23 13:04:05 +0000 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-12 15:15:32 +0100 |
commit | 007393a09d046909a6cc50297b8d39d61336a010 (patch) | |
tree | 79fba6cd5c2d288a89b3201202c3b81c0bf066a9 | |
parent | 568072ceae5566c4e3e14cef077538d2f454ee33 (diff) | |
download | node-new-007393a09d046909a6cc50297b8d39d61336a010.tar.gz |
v8: use correct timezone information on Solaris
`timezone` variable contains the difference, in seconds, between UTC and
local standard time (see `man 3 localtime` on Solaris).
Call to `tzset` is required to apply contents of `TZ` variable to
`timezone` variable.
BUG=v8:2064
Review URL: https://chromiumcodereview.appspot.com/10967066
Patch from Maciej MaĆecki <me@mmalecki.com>.
This is a back-port of upstream commit r12802 and a forward port of
commit 9fa953d from the v0.8 branch. V8 3.22 in the master branch
contains the patch so no further forward-porting is necessary.
-rw-r--r-- | deps/v8/src/platform-solaris.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/deps/v8/src/platform-solaris.cc b/deps/v8/src/platform-solaris.cc index 4248ea214f..07718fe50b 100644 --- a/deps/v8/src/platform-solaris.cc +++ b/deps/v8/src/platform-solaris.cc @@ -125,12 +125,8 @@ const char* OS::LocalTimezone(double time) { double OS::LocalTimeOffset() { - // On Solaris, struct tm does not contain a tm_gmtoff field. - time_t utc = time(NULL); - ASSERT(utc != -1); - struct tm* loc = localtime(&utc); - ASSERT(loc != NULL); - return static_cast<double>((mktime(loc) - utc) * msPerSecond); + tzset(); + return -static_cast<double>(timezone * msPerSecond); } |