Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序在Android平台,加载dayjs timezone插件后,dayjs.tz()转换时区时不生效 #16078

Open
Harley-Chang opened this issue Jul 9, 2024 · 0 comments

Comments

@Harley-Chang
Copy link

这个特性解决了什么问题?

环境:

node:v18.0.0

npm:8.6.0

"@tarojs/taro": "3.6.19"

"dayjs": "^1.11.10"

期望:dayjs.tz按照固定时区转换时间

例如:dayjs('2024-07-02T02:00:00Z').tz('Asia/Shanghai').format(‘YYYY年MM月DD日 HH:mm’)会按照这个时区显示为2024年07月02日10:00

问题:Android会按照手机设置的时区转换时间

这个 API 长什么样?

已在程序入口设置

    dayjs.extend(utc);
    dayjs.extend(localeData);
    dayjs.extend(timezone);
    dayjs.tz.setDefault('Asia/Shanghai');

问题:dayjs(date).tz()不会根据默认的时区设置,转换时间

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant