The new Date () function to pass parameters, in Firefox and Google browser console run, will get different results, just start to feel impossible, and then the actual operation found this trap.
In Firefox:
var dstring = "2015-06-22 16:40:18";
var dTime = new Date (dstring);
There is no result date, and chrome can normally be converted to a date type. While
var date =
new
Date(
‘2014-07-25T23:00:00‘
);
alert(date);
The results are also different in two browsers.
In contrast, the Google browser takes the string passed in as UTC time, plus 8 hours (Beijing is in the East eight), and the new Date () is called the Date.parse (' 2014-07-25t23:00:00z ') function.
While Firefox is not automatically added as a local time zone, the UTC format string in Firefox is finally added with Z (z for Zulu, GMT).
Of course, you can also add a 0 time zone offset "+00:00", such as ' 2014-07-25t23:00:00+00:00 ', at the end of the UTC string.
The new date () in Firefox does not support the horizontal-representation date format, which can be converted to/from the format and then to new.
The difference between Chrome and Firefox for time processing