Date.prototype.autoString = function() {
var month = this.getMonth() + 1;
var day = this.getDate();
month = month < 10 ? '0' + month : month;
day = day < 10 ? '0' + day : day;
var val = this.getFullYear() + "-" + month + "-" + day;
return val;
}
-时间加减
//日期加一 其他同理
let now = new Date();
now.setDate(now.getDate() +1);
网友评论