const detailtimes = (date) => { // times为时间对象
if (date) {
var Y = date.getFullYear() + '/'
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/'
var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds())
const strDate = Y + M + D + h + m + s
return strDate
}
}
时间格式处理
最新推荐文章于 2022-07-27 10:35:12 发布
217

被折叠的 条评论
为什么被折叠?



