JavaScript new Date(string) returns different results on exactly identical date strings
date, javascript, string
Solution
The first one contains non printable
0x20 0x3D 0x20 0x22
characters
Problem
I would like to share something I found with JavaScript today. Simple example here ``` d1 = "2014-07-15T14:00:00.000Z" d2 = "2014-07-15T14:00:00.000Z" ``` The input strings are ISO formatted using `new Date().toISOString();`. I received the first date from a server where it was stored in mongoDB as ISOString, and the second one was created manually. If I do `new Date(d1);`, it returns 'Invalid Date' but if I do the same for `d2` it returns the correct date.