iamkun / dayjs

⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
https://day.js.org
MIT License
46.85k stars 2.29k forks source link

dayjs("2024-04-21T16:00:00Z").tz("Asia/Shanghai").format('YYYY.MM.DD') does not work on android wechat miniprogram (微信小程序) #2635

Open TobinXu opened 6 months ago

TobinXu commented 6 months ago

Describe the bug

"dayjs": "^1.11.10" when i use .tz("Asia/Shanghai") to format the date, i got a error answer '2024.04.22' on android phone but correct on ios phone, thats crazy! maybe the dayjs ignore the date's timezone info,

Expected behavior

get the correct '2024.04.22'

Information

iamkun commented 5 months ago

Day.js supports time zone via the Internationalization API in supported environments

https://day.js.org/docs/zh-CN/timezone/timezone