Given the following standardized date string:
var dateString = "2010-12-23T23:12:00";
I can use one of the following snippets of code to parse it:
Example 1:
var date = new Date(dateString);
Example 2:
var date = new Date(Date.parse(dateString));
According to this answer, date parsing is only well-defined when the string is of the format YYYY-MM-DDTHH:mm:ss.sssZ
. If the string is in that format, however, I would imagine that the two examples would always return the exact same result.
What are the technical differences between these two approaches to creating a date object from a standardized date string, and do they ever return different results?