What time zone is the new Date () Javascript used in?
Date objects work with the number of milliseconds since the Epoch (January 1, 1970 at midnight GMT). They have methods like getDay and getMonth and those that use the local time zone for the JavaScript engine, as well as functions like getUTCDay and getUTCMonth that use UTC (free, GMT).
If you parse a string, you must be sure that the string is in a format that Date can parse. Only a specific simplified derivative format from ISO-8601 is specified in the specification, but it was added only in ES5 and they were mistaken in the specification of what should happen if there is no time zone indicator in the line, so you definitely need to have a time zone indicator (on ES6 will fix it for now, and ultimately the engines will reliably use ES6 behavior). These lines are as follows:
"2015-03-27T09:32:54.427Z"
You can create this format using the toISOString method.
Tj crowder
source share