1.0.1 • Published 2 years ago
myyyymmxx v1.0.1
1.安装方式
2.导入方式
const my =
3.格式化时间
function dateFormat() {
var date = new Date()
//年份
var year = date.getFullYear()
//月份
var month = date.getMonth() + 1
//日期
var day = date.getDate()
//小时 分钟 秒
var hh = date.getHours()
var mm = date.getMinutes()
var ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return `${year}年${month}月${day}日 ${hh}:${mm}:${ss}`
}