[add] 分标委在研项目

This commit is contained in:
zhaoxiao
2021-12-14 15:03:03 +08:00
parent 931af39e09
commit f1a10730cf
3 changed files with 28 additions and 5 deletions
+19
View File
@@ -660,3 +660,22 @@ export function isAllEqual(array) {
return true
}
}
/**
* 将时间戳转换为YYYY-MM-DD HH:mm:ss格式
*/
export function processingTimestamp(value) {
let data = new Date(value)
let y = data.getFullYear()
let m = data.getMonth() + 1
m = m < 10 ? ('0' + m) : m
let d = data.getDate()
d = d < 10 ? ('0' + d) : d
let h = data.getHours()
h = h < 10 ? ('0' + h) : h
let minute = data.getMinutes()
let second = data.getSeconds()
minute = minute < 10 ? ('0' + minute) : minute
second = second < 10 ? ('0' + second) : second
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second
}