次のようにコードコードをコピーします。
/**
*時間オブジェクトの定式化。
*/
date.prototype.format = function(format){
/*
*例:format = "yyyy-mm-dd hh:mm:ss";
*/
var o = {
「M +」:this.getMonth() + 1、//月
「D+」:this.getDate()、// day
「H+」:this.gethours()、// hour
「M+」:this.getMinutes()、// minuts
「S+」:this.getSeconds()、// second
「Q +」:math.floor((this.getmonth()) + 3)、// Quarter
「S」:this.getMilliseConds()
// millisecond
}
if(//y+)/.test(format)){{
format = format.replace(regexp。$ 1、(this.gettlyear() + "")
.substr(4 -regexp。$ 1.Length);
}
for(var k in o){
if(new regexp( "(" + k + ")")。test(format){
format = format.replace(regexp。$ 1、regexp。$ 1.length == 1?o [k]
:( "00" + o [k])。
}
}
返品形式。
}
次のようにコードコードをコピーします。
var now = new date()。
次のようにコードコードをコピーします。
new Date()