The General direct new Date () is not a compatibility issue, and the new date (datetimeformatstring) often has browser compatibility issues, why some format browsers in datetimeformatstring are incompatible.
1. No reference
// no reference all browsers are compatible var New Date ();
2. Date parameters
// Date parameter Format 1 var New Date ("2017-09-12");
A. IE
> ie9-(Incompatible)
> ie9+ (compatible, including IE9)
B. Firefox (compatible)
C. Google (compatible)
// Date parameter Format 2 All browsers are compatible var New Date ("2017/09/12");
3. Date and Time parameters
// Date Time parameter Format 3 var New Date ("2017-09-12t13:42:00");
// Date Time parameter format 1 var New Date ("2017-09-12 13:41:00");
A. IE (incompatible, no matter which version)
B. Firefox (not compatible)
C. Google (compatible)
// Date Time parameter format 2 All browsers are compatible var New Date ("2017/09/12 13:42:00");
A. IE
> ie9-(Incompatible)
> ie9+ (Compatible)
> IE9 (Semi-compatible 8-hour time difference)
B. Firefox (compatible)
C. Google (half-compatible 8-hour time difference)
// Date Time parameter format 4 var New Date ("2017/09/12t13:42:00");
A. IE (half-compatible 1-hour time difference)
B. Firefox (not compatible)
C. Google (not compatible)
Attention:
In all, the formats supported by all major browsers are: var dateTime = new Date ("2017/09/12 13:42:00");
So the solution is to convert datetimeformatstring to YYYY/MM/DD HH:MM:SS formatted string
JS date () Day function Browser compatibility problem solving method