Bug 196894

Summary: Date parses time-and-time string without timezone incorrectly
Product: WebKit Reporter: T.J. Crowder <tj>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: fpizlo, keith_miller, msaboff, ross.kirsling, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: Safari 12   
Hardware: Unspecified   
OS: Unspecified   

T.J. Crowder
Reported 2019-04-13 02:36:38 PDT
JavaScriptCore parses dates in this format incorrectly, because there's no timezone indicator but there is a time portion: ```js new Date("2019-04-13T09:00:00") ``` It should parse it in _local time_, but parses it as UTC instead. V8, SpiderMonkey, and Chakra parse it correctly. This fiddle demonstrates the problem: https://jsfiddle.net/tjcrowder/ojmh3fsv/2/ The rules changed between ES2015 and ES2016 but have been stable since. Current rules are here: https://tc39.github.io/ecma262/#sec-date.parse > When the UTC offset representation is absent, date-only forms are > interpreted as a UTC time and date-time forms are interpreted as > a local time. This bug is similar to #89071 but that report (from 2012) is severely outdated now, not least because it predates this being added to the specification. (I believe #89071 can be closed as some form of "no longer relevant." Or if not, this can be made a duplicate of that and we can update its description.)
Attachments
Radar WebKit Bug Importer
Comment 1 2019-04-13 20:14:23 PDT
Ross Kirsling
Comment 2 2020-01-03 15:19:23 PST
Closing as duplicate, since bug 89071 comment 2 provides the updated spec context you mentioned. *** This bug has been marked as a duplicate of bug 89071 ***
Note You need to log in before you can comment on or make changes to this bug.