Time zone offsets for any time zone, possible change to Date functionality (i18n)

Nebojša Ćirić cira at google.com
Tue Apr 9 11:30:55 PDT 2013

We need to support conversion between:
{Y, M, D, H, M, S, AnyTimeZone*} <=> {UTC Epoch millis}

*AnyTimeZone - doesn't have to be system one, supports IANA tz format.

We currently implement that by using the Javascript Date object's UTC
representation and TimeZone knowledge which can provide the offset from UTC
at a point in time.
Problem: timezone data needs to be synced, requires network roundtrip + js
evaluation + object creation in the critical path of the initial load. JSON
payload: ~300k uncompressed, ~30k compressed. 300k data set represents only
span of couple of years.

Since we (i18n) already have timezone data for date formatting, we could do
what we did for Date.prototype.toLocaleDateString and extend say
Date.prototype.getTimezoneOffset method to support timezone parameter.

Internet has lots of
to this topic, and answers are not 100% satisfactory.

We could discuss this on our next i18n ad-hoc meeting (tentative date
2013-04-19, 9:30am) if we have time, but I think it's a good question for
the main group too.

  Nebojša Ćirić
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130409/725167fe/attachment.html>

More information about the es-discuss mailing list