js的时间格式化,时间戳转日期快捷方法
/** * 日期格式化 */export function dateFormat(date = new Date(), format = 'yyyy-MM-dd hh:mm:ss') { // let format = 'yyyy-MM-dd hh:mm:ss' if (date !== 'Invalid Date') { var o = { 'M+': date.getMonth() + 1, //month 'd+': date.getDate(), //d
原创
2021-03-15 08:50:50 ·
369 阅读 ·
0 评论