代码如下: function dateFormat(date, format) { var o = { “M+”: date.getMonth() + 1, //month “d+”: date.getDate(), //day “h+”: date.getHours(), //hour “m+”: date.getMinutes(), //minute “s+”: date.getSeconds(), //second “q+”: Math.floor((date.getMonth() + 3