Skip to content

Commit 2fc205e

Browse files
authored
Merge pull request #50 from mh739025250/main
bug fix: format timesatmp with timezone correctly
2 parents 990abbe + 08d56bc commit 2fc205e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web/src/filters/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ dayjs.extend(timeZone);
77

88
const filters = {
99
second2Date: (sec) => {
10-
return dayjs(sec * 1000).utc(true).local().format("YYYY-MM-DD HH:mm:ss");
10+
return dayjs(sec * 1000).utc().local().format("YYYY-MM-DD HH:mm:ss");
1111
},
1212
second2YearMonth: (sec) => {
13-
return dayjs(sec * 1000).utc(true).local().format("YYYY-MM")
13+
return dayjs(sec * 1000).utc().local().format("YYYY-MM")
1414
},
1515
second2ChineseYearMonth: (sec) => {
16-
return dayjs(sec * 1000).utc(true).tz("Asia/Shanghai").format("YYYY年MM月DD日 E 中国标准时间 a hh:mm:ss")
16+
return dayjs(sec * 1000).utc().tz("Asia/Shanghai").format("YYYY年MM月DD日 E 中国标准时间 a hh:mm:ss")
1717
},
1818
privacyPhoneNum: (num) => {
1919
var reg = /^(\d{3})\d{4}(\d{4})$/;

0 commit comments

Comments
 (0)