|
|
|
@ -27,13 +27,17 @@ function time2Date(time, isOffset = false) { |
|
|
|
if (time.toString().length <= 10) { |
|
|
|
time = Number(time) * 1000; |
|
|
|
} |
|
|
|
let timeN; |
|
|
|
// 是否对时差进行转化
|
|
|
|
if (isOffset) { |
|
|
|
time = getTimeZoneOffset(time); |
|
|
|
timeN = getTimeZoneOffset(time); |
|
|
|
}else{ |
|
|
|
// 这也是对时差进行转换,但是不想在每个处理时间格式的组件中修改isOffset为true
|
|
|
|
timeN = time - (new Date(time).getTimezoneOffset()* 60 * 1000) - (480 * 60 * 1000); |
|
|
|
} |
|
|
|
|
|
|
|
// 转化成日期时间对象
|
|
|
|
date = new Date(time); |
|
|
|
date = new Date(timeN); |
|
|
|
} |
|
|
|
return date; |
|
|
|
} |
|
|
|
@ -79,6 +83,7 @@ function parseTime(time, isOffset = false, cformat = null) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 发布日期的特定显示方式, |
|
|
|
* @param {string|number} time 显示日期的时间戳 |
|
|
|
|