Operating with arbitrary timezones
Jordan Harband
ljharb at gmail.com
Thu Aug 4 23:16:31 UTC 2016
This message was in my Gmail spam folder due to "It has a from address in
yahoo-inc.com but has failed yahoo-inc.com's required tests for
authentication." - so it's possible nobody saw it.
Replying all to bump.
On Fri, Jul 29, 2016 at 12:51 PM, Juan Dopazo <jdopazo at yahoo-inc.com> wrote:
> Hello,
>
> I’ve been working on Yahoo Mail and we’ve been running into multiple
> issues with timezones. Currently EcmaScript supports only creating Date
> objects with the User Agent’s timezone. However, we need to be able to
> operate with whatever timezone our users selected in their settings page.
> In most cases we just need to render dates with the correct timezone and
> this is currently available using the Ecma 402 APIs. However, in other
> cases we need to make certain computations taking into account an arbitrary
> timezone and this is not covered by either EcmaScript or Ecma 402.
>
> In particular, we need to answer the following questions:
>
> - Is a certain date in the current day/month/year? This means given a
> Date object, is it in the current day for an arbitrary timezone?
> - When is the start of the day/month for this timezone?
>
> Currently the only way to answer these questions is by calculating the
> timezone offset for the timezone around the date we’re studying. And the
> way to do that is to render a date using Intl.DateTimeFormat and recreate a
> date object: https://gist.github.com/juandopazo/
> b52820e368739ed19cb206e3f3893166.
>
> Ideally, EcmaScript would allow developers to operate on a Date object for
> an arbitrary timezone. Would date.setTimezone(/* IANA string identifier */)
> work? I know it’s a problem that is in the middle between EcmaScript and
> Ecma 402.
>
> Thank you,
>
> Juan Dopazo
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160804/2fd716a9/attachment-0001.html>
More information about the es-discuss
mailing list