Re: getTimezoneOffse: do what I want it to

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