- From: Brendan Eich <brendan@secure.meer.net>
- Date: Mon, 21 Apr 2014 15:31:48 -0700
- To: Garrett Smith <dhtmlkitchen@gmail.com>
- CC: "public-script-coord@w3.org" <public-script-coord@w3.org>, "es-discuss@dm-mailman01.mozilla.org" <es-discuss@dm-mailman01.mozilla.org>
Wrong list -- you obviously want es-discuss, since this is a core
ECMAScript question.
I think it would be awesome if Date objects captured position on planet
and therefore enabled a getTimezoneOffset *method* that returned their
specific TZ offset as constructed. FWIW.
/be
> Garrett Smith <mailto:dhtmlkitchen@gmail.com>
> April 21, 2014 at 3:27 PM
> What is the right way to associate a timezone with a Date object. Date
> object does not keep timezone information.
>
> var d = new Date("2014-05-01T00:00+08:00");
> d.getTimezoneOffset() / 60
>
> 7.
>
> If I want Shanghai timezone, I would have to create a decorator for
> the Date. I wish there was some way to deal with that in EcmaScript.
> When did this come up last? Sorry I probably missed it. Any threads I
> should read up on?
>
> Thanks,
Received on Monday, 21 April 2014 22:32:19 UTC