Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to parse date strings with timeone #5502

Closed
d3x0r opened this issue Jul 23, 2018 · 2 comments
Closed

Failure to parse date strings with timeone #5502

d3x0r opened this issue Jul 23, 2018 · 2 comments

Comments

@d3x0r
Copy link

d3x0r commented Jul 23, 2018

new Date( "2018-07-23 09:53:16.752-07:00" );

The above results (in Edge console) [date] Invalid Date:

Firefox and chorme have supported this for 8+ years.

https://stackoverflow.com/questions/2182246/date-constructor-returns-nan-in-ie-but-works-in-firefox-and-chrome

new Date( "2018-07-23 09:53:16.752-07:00" );
new Date( "2018-07-23 09:53:16.752+07:00" );
// this one works - it's the only variant with timezone that does
new Date( "2018-07-23 09:53:16.752Z" );  

all of those work in Node, chrome, firefox, my C library that parses javascript times.

@MikeHolman
Copy link
Contributor

@jackhorton FYI. Seems like this might be winglob/ICU issue?

@jackhorton
Copy link
Contributor

Oops, completely missed this one. We actually use custom parsing for the date constructor (since I think the JS spec at least hints at the algorithm, if it doesn't define it outright), so this should be a problem regardless of the Intl implementation.

@MikeHolman MikeHolman added this to the vNext milestone Jul 27, 2018
duongnhn added a commit to duongnhn/ChakraCore that referenced this issue Aug 15, 2018
duongnhn added a commit to duongnhn/ChakraCore that referenced this issue Aug 16, 2018
duongnhn added a commit to duongnhn/ChakraCore that referenced this issue Aug 16, 2018
duongnhn added a commit to duongnhn/ChakraCore that referenced this issue Aug 16, 2018
chakrabot pushed a commit that referenced this issue Aug 16, 2018
…fset

Merge pull request #5602 from duongnhn:user/duongn/date-parse-time-zone-offset

according to http://www.ecma-international.org/ecma-262/#sec-date-time-string-format, the time zone offset Z can be character 'z' or '+/-HH:mm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants