1.格式 yyyy-MM-dd HH:mm:ss 参数new Date()
FormatTime: function (date) {
var splitDate = "-";
var splitTime = ":";
var strDate = date.getFullYear();
var d = date.getMonth();
if (d >= 0 && d < 9) {
d += 1;
d = "0" + d;
}
strDate += splitDate+d
d = date.getDate();
if (d >= 0 && d < 10) {
d = "0" + d;
}
strDate += splitDate+d
d = date.getHours();
if (d >= 0 && d < 10) {
d = "0" + d;
}
strDate += " "+d
d = date.getMinutes();
if (d >= 0 && d < 10) {
d = "0" + d;
}
strDate +=splitTime+d
d = date.getSeconds();
if (d >= 0 && d < 10) {
d = "0" + d;
}
strDate +=splitTime+d
return strDate
}