Closed
Bug 1676708
Opened 4 years ago
Closed 3 years ago
Invalid date parsing with GMT starting with 00
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
87 Branch
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: calixte, Assigned: calixte)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
For example in Firefox nightly 84:
>> new Date("Wed Nov 11 2020 19:18:50 GMT+0010 (Central European Standard Time)").toUTCString()
-> "Wed, 11 Nov 2020 09:18:50 GMT"
when it should be "Wed, 11 Nov 2020 19:08:50 GMT"
Assignee | ||
Comment 1•4 years ago
|
||
We probably need to check partLength
too here:
https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp#1187
Assignee: nobody → cdenizet
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•4 years ago
|
||
The MDN documentation specifies that 00xx stands for 0 hours and xx minutes.
So that patch adds a check with the length of the offset to be sure that minutes won't become hours.
Updated•4 years ago
|
Severity: -- → S4
Priority: -- → P1
Comment 3•3 years ago
|
||
Calixte, would you have time to move the test case to a different file, as suggested in https://phabricator.services.mozilla.com/D96755#3166362 ?
Flags: needinfo?(cdenizet)
Assignee | ||
Comment 4•3 years ago
|
||
I just moved the test in parse-time-zone.js
file.
Flags: needinfo?(cdenizet)
Pushed by cdenizet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/29161b592e83 Parse a date with GMT+00xx leads to an incorrect timezone offset r=jorendorff
Comment 6•3 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox87:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•