/*
格式化日期
format:格式(yyyy-MM-dd hh:mm:ss)
*/
Date.prototype.format = function (format) {
var o = {
"M+": this.getMonth() + 1, //月
"d+": this.getDate(), //日
"h+": this.getHours(), //时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"S": this.getMilliseconds(), //毫秒
"q+": Math.floor((this.getMonth() + 3) / 3) //季度
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.ge......
阅读全文