Only 3 browsers are tested here: IE, Firefox, Google.
I. Non-reference
// No reference var New Date ();
All browsers are compatible, good
Two. Date parameters
// Date parameter Format 1 var New Date ("2016-05-20");
A. IE
> ie9-(Incompatible)
> ie9+ (compatible, including IE9)
B. Firefox (compatible)
C. Google (compatible)
// Date parameter Format 2 var New Date ("2016/05/20");
All browsers are compatible, good
Three. Date and time parameters
// Date Time parameter format 1 var New Date ("2016-05-20 23:41:00");
A. IE (incompatible, no matter which version)
B. Firefox (not compatible)
C. Google (compatible)
// Date Time parameter format 2 var New Date ("2016/05/20 23:42:00");
All browsers are compatible, good
// Date Time parameter Format 3 var New Date ("2016-05-20t23:42:00");
A. IE
> ie9-(Incompatible)
> ie9+ (Compatible)
> IE9 (semi-compatible)
What's a half-compatible? Ha ha. Semi-compatibility is the time to get a date, but the time is wrong. For example, our time is 23:42:00. Then it will automatically add 8 hours on this basis, so the value we get for DateTime will be: 2016-05-21 07:42:00
B. Firefox (compatible)
C. Google (semi-compliant) with IE9 time increased by 8 hours
// Date Time parameter format 4 var New Date ("2016/05/20t23:42:00");
A. IE (semi-compatible) all versions have been added for 1 hours, that is, the resulting dateTime value is: 2016-05-21 00:42:00
B. Firefox (not compatible)
C. Google (not compatible)
based on the results of the above tests, the formats supported by all browsers are: var dateTime = new Date ("2016/05/20 23:42:00");
JS code Browser compatibility new Date ()