[Webkit-unassigned] [Bug 196894] New: Date parses time-and-time string without timezone incorrectly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 13 02:36:38 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=196894

            Bug ID: 196894
           Summary: Date parses time-and-time string without timezone
                    incorrectly
           Product: WebKit
           Version: Safari 12
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: tj at crowdersoftware.com

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.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190413/ac9c63b9/attachment.html>


More information about the webkit-unassigned mailing list