iamkun / iamkun/dayjs

dayjs timezone is not work in expo app

Open
#2,864 9 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

```
const a = dayjs(new Date(1384775720)).tz("America/Toronto").format("HH:mm:ss");
const b = dayjs(new Date(1384775720)).tz("Asia/Shanghai").format("HH:mm:ss");
```

Put the above code into the nodejs running environment. It shows:

```
{ a: '19:39:35', b: '08:39:35' }
```

And put it into expo app(https://expo.dev/)

it shows:
```
00:39:35
```
Image

Here's my minimal reproduction
https://github.com/SteveYuOWO/expo-dayjs-reproduction

Contributor guide

Open the contributing guide

Research direction

Run the provided snippet in the Node.js environment and then reproduce it in the linked Expo minimal reproduction. Compare the timezone results for America/Toronto and Asia/Shanghai; done means the Expo app produces the same converted times as Node.js.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.