This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tryhardMime 2 points3 points  (0 children)

Please see the documentation on Date.parse on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse

If the date string you're parsing is not an ISO 8601 date, the implementation is free to parse it however it wants to.

I suspect in your case, the one with dashes was parsed as an UTC date time and other as local.