La méthode date.prototype.toisostring a été ajoutée dans ES5, pas dans le document ES3, comme suit
Cette méthode n'est pas prise en charge dans IE6 / 7/8 et peut être fixée comme suit
La copie de code est la suivante:
if (! date.prototype.toisostring) {
Date.prototype.toisostring = function () {
Fonction Pad (n) {return n <10? '0' + n: n}
retourne this.getUtCulyear () + '-'
+ pad (this.getutcmonth () + 1) + '-'
+ pad (this.getutcdate ()) + 't'
+ pad (this.getutchours ()) + ':'
+ pad (this.getUtcMinutes ()) + ':'
+ pad (this.getUtcSeconds ()) + '.'
+ pad (this.getUtcMilliseconds ()) + 'z';
}
}
En rapport:
http://msdn.microsoft.com/zh-cn/library/ie/ff925953%28v=vs.94%29.aspx
https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/date