Closed Bug 895737 Opened 11 years ago Closed 5 years ago

DateTimeFormat doesn't track current time zone

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1348916

People

(Reporter: mozillabugs, Unassigned)

References

Details

According to ECMA-402, section 6.4, Intl.DateTimeFormat uses the host environment’s current time zone if no time zone is provided to the constructor. Bug 796523 enabled the implementation of Date objects to track the operating system's time zone, but DateTimeFormat doesn't do that yet. As a result, toString and toLocaleString (with no time zone specified) can produce output reflecting different time zones at the same time. This can be observed, for example, with the test case at
http://norbertlindenberg.com/ecmascript/DateTest.html
See also
https://mail.mozilla.org/pipermail/es-discuss/2013-July/032087.html
Assignee: general → nobody
Would fixing this bug also provide the current OS timezone via Intl.DateTimeFormat().resolvedOptions().timeZone ? Also a related side question, is there an event of some sort when the system timezone changes?
Depends on: 837961
Andre, this also seems fixed now, am I correct?
Flags: needinfo?(andrebargull)
IIRC the DateTest.html page (before it went 404) also tested the behaviour when the time zone is manually changed during the life time of a web page. We still don't have that part correctly implemented (bug 1343826), so we probably should keep this bug open.
Depends on: 1343826
Flags: needinfo?(andrebargull)

All time zone computations are now handled through ICU, so we can close this particular bug. Missing time zone updates when the host time zone changes is already tracked in bug 1348916 (among others).

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
No longer blocks: 1158733
You need to log in before you can comment on or make changes to this bug.