function formatDate(fmt, date) {
let d = new Date(date)
console.log("----")
console.log(typeOf d)
return fal
var o = {
'M+': d.getMonth() + 1,
'd+': d.getDate(),
'h+': d.getHours(),
'm+': d.getMinutes(),
's+': d.getSeconds(),
'q+': Math.floor((d.getMonth() + 3) / 3),
'S': d.getMilliseconds()
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
}
}
return fmt;
}
let d2 = formatDate('hh时mm分ss秒','ss s上世纪')
console.log(d2)
console