[3rd-Party Apps] chrome内核浏览器无法获取时区
Tofloor
poster avatar
有点坏
deepin
2024-04-30 10:08
Author

chrome 版本 124.0.6367.91(正式版本) (64 位)

edge 版本 123.0.2420.53

edge 版本 115.0.1901.189+szbt2

在控制台使用

console.log(new Date().toString());
console.log(new Date().getTimezoneOffset());

方法获取浏览器时区时返回GMT+0000

而使用系统自带浏览器可返回GMT+0800

由此导致以浏览器时区为依据显示时间的页面无法正确显示时间。

系统版本为 社区版(20.9)

timedatectl返回

               Local time: 二 2024-04-30 10:06:26 CST
           Universal time: 二 2024-04-30 02:06:26 UTC
                 RTC time: 二 2024-04-30 02:06:26
                Time zone: Asia/Beijing (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
Reply Favorite View the author
All Replies
TSAC
deepin
2024-04-30 10:16
#1

老问题了
时区改成 上海
应该就正常了

Reply View the author
Ziggy
deepin
2024-04-30 10:29
#2

可以换成上海时区看看,V23针对该问题有经过优化处理

Reply View the author
有点坏
deepin
2024-04-30 10:38
#3

改Shanghai果然好使了

顺便问一嘴,v23现在进化怎样了,坑多吗

Reply View the author