|
@@ -1,5 +1,6 @@
|
|
// 时间戳转换为年月日时分秒
|
|
// 时间戳转换为年月日时分秒
|
|
export const timesTampChange = (timestamp) => {
|
|
export const timesTampChange = (timestamp) => {
|
|
|
|
+ if (!timestamp) return ''
|
|
const date = new Date(timestamp)
|
|
const date = new Date(timestamp)
|
|
const Y = date.getFullYear() + '-'
|
|
const Y = date.getFullYear() + '-'
|
|
const M = (date.getMonth() + 1).toString().padStart(2, '0') + '-'
|
|
const M = (date.getMonth() + 1).toString().padStart(2, '0') + '-'
|
|
@@ -14,6 +15,7 @@ export const timesTampChange = (timestamp) => {
|
|
|
|
|
|
// 将 Wed May 01 2024 00:00:00 GMT+0800 (中国标准时间) 转换为时间戳
|
|
// 将 Wed May 01 2024 00:00:00 GMT+0800 (中国标准时间) 转换为时间戳
|
|
export const getTimeStamp = (str) => {
|
|
export const getTimeStamp = (str) => {
|
|
|
|
+ if (!str) return ''
|
|
const date = new Date(str)
|
|
const date = new Date(str)
|
|
return date.getTime()
|
|
return date.getTime()
|
|
}
|
|
}
|