摘要: // 封装日期格式化函数 const date = new Date('2021-4-12 10:22:22'); function dateFormat (date, format = 'YYYY-MM-DD HH:mm:ss') { const config = { YYYY: date.ge 阅读全文
posted @ 2021-04-13 20:30 易函123 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 时间转变为时间戳的方法汇总 const date = new Date('2021-4-12 08:22:22'); console.log(date); // Mon Apr 12 2021 08:22:22 GMT+0800 (中国标准时间) console.log(date * 1); //1 阅读全文
posted @ 2021-04-13 20:27 易函123 阅读(207) 评论(0) 推荐(0) 编辑