Metode Tanggal
Metode ini tidak didukung dalam IE6/7/8, dan dapat diperbaiki sebagai berikut
Salinan kode adalah sebagai berikut:
if (! date.prototype.toisOstring) {
Date.prototype.toisOstring = function () {
function pad (n) {return n <10? '0' + n: n}
kembalikan this.getutcear () + '-'
+ pad (this.getutcmonth () + 1) + '-'
+ pad (this.getutcdate ()) + 't'
+ pad (this.getutchours ()) + ':'
+ pad (this.getutcminutes ()) + ':'
+ pad (this.getutcseconds ()) + '.'
+ pad (this.getutcmilliseconds ()) + 'z';
}
}
Terkait:
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