The Date.prototype.toISOString method was added in ES5 and is not included in the ES3 document. It is as follows:
This method is not supported in IE6/7/8. You can do it as follows Repair
if (!Date.prototype.toISOString) {
Date.prototype.toISOString = function() {
function pad(n) { return n < 10 ? '0' n : n }
return this.getUTCFulYear() '-'
pad(this.getUTCMonth() 1) '-'
pad(this.getUTCDate()) 'T'
pad(this.getUTCHours()) ':'
pad(this.getUTCMinutes() ) ':'
pad(this.getUTCSeconds()) '.'
pad(this.getUTCMilliseconds()) 'Z';
}
}
Related:
http://msdn.microsoft.com/zh-cn/library/ie/ff925953(v=vs.94).aspx
https://developer.mozilla.org/en-US/ docs/Web/JavaScript/Reference/Global_Objects/Date