Does changed timezone notification still required in latest v8?

35 views
Skip to first unread message

Bogdan Padalko

unread,
Jan 29, 2016, 1:38:29 PM1/29/16
to v8-users

Hi, after upgrading to latest v8 from master (say, v4.10.43) on linux (ubuntu 15.10) and os x (10.11.3) changing timezone with putennv("TZ=<timezone>") (http://man7.org/linux/man-pages/man3/putenv.3.html) new timezone affects v8 runtime without calling v8::Date::DateTimeConfigurationChangeNotification. I guess it happens after "[runtime] Migrate several Date builtins to C++" (https://github.com/v8/v8/commit/065e9c536f14b3d7cb4d140c6f74e024e31ee1a2) commit.



Here is some meta-code to demonstrate problem:



putenv("TZ=America/New_York");
v8
::Date::DateTimeConfigurationChangeNotification();
v8
::MaybeLocal<v8::Date> date = v8::Date::New(context, 1445444940000.0).ToLocalChecked();

date
.ToLocalChecked()->ToString(context); // Wed Oct 21 2015 09:29:00 GMT-0700 (EDT)

putenv
("TZ=UTC");
date
.ToLocalChecked()->ToString(context); // Wed Oct 21 2015 09:29:00 GMT-0700 (UTC)



before (apr. that changes I mentioned above) both ToString() returned EDT time.

Based on  this, I have few questions:
  1. How now TZ changes handled internally, if any?
  2. What is recommended way to handle TZ changes?
  3. Is using v8::Date::DateTimeConfigurationChangeNotification() still mandatory to notify TZ changes?

Ulan Degenbaev

unread,
Feb 1, 2016, 9:02:16 AM2/1/16
to v8-users
The recommended way is still to call v8::Date::DateTimeConfigurationChangeNotification() after TZ change.

Without the call it is not guaranteed that V8 will pick the TZ change.

Cheers,
Ulan.

--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bogdan Padalko

unread,
Feb 1, 2016, 4:48:33 PM2/1/16
to v8-users
Thanks for the clarification!
Reply all
Reply to author
Forward
0 new messages