Reputation: 3978
I would like to share something I found with JavaScript today.
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.
Upvotes: 4
Views: 74
Reputation: 255135
The first one contains non printable
0x20 0x3D 0x20 0x22
characters
Upvotes: 5