I. The date and time returned by the server has a T
The date type data for the action return foreground in ASP. NET MVC is a T, such as: 2015-07-07t10:15:01.
Such data will be automatically added to the Chrome browser for 8 hours, as follows:
And in IE, there is no problem,
Workaround: You can handle JSON serialization: you need to use the Newtonsoft.json serialization output,
New jsonserializersettings (); = Dateformathandling.isodateformat; " YYYY-MM-DD HH:mm:ss " ; New Func<jsonserializersettings> (() = { return setting; });
Two. JavaScript handling of dates and times with T
My plan is to replace T.
function (datestring) { if (! datestring) { return ""; } return New Date (Datestring.replace (/t| z/g, "); },
Three. Differences in date processing between IE and Chrome browser
The main difference is that IE does not recognize the date type, such as: 2015-07-07 10:15:01, if it is only a date, is possible,
And Chrome is all you can
The solution is to replace the date '-' with a '/'
function (datestring) { if (! datestring) { return ""; } return New Date (Datestring.replace (/-/g, '/'). Replace (/t| z/g, "); },
Four. Under the Spit slot ie
IE8, this also error, and the high version of IE is no problem
The time to add T, and the time without T is not the same
JavaScript date format processing