dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

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

Open TobinXu opened this issue 1 year ago • 1 comments

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

  • Day.js Version [v1.11.10]
  • OS: [android]
  • Time zone: [e.g. GMT+08:00 (Asia/Shanghai)]

TobinXu avatar Apr 22 '24 03:04 TobinXu

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

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

iamkun avatar Apr 27 '24 17:04 iamkun