-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Problem with timezones in react native #2372
Comments
same issue here |
Same issue, @VictorPulzz @Willham12 did you guys found anything to fix this issue ? |
No, i'm still using momentjs |
@sam-houle1 Unfortunately, without pollyfil, it doest work. You can try set offset monually like this: // get offset use any date
const getOffset = dayjs.tz('2023-09-04 12:00:00', tz).utcOffset();
// set offset for any date
dayjs.utc(date).utcOffset(getOffset) |
@Willham12 Does momentjs not have timezones issue in React Native? If no, then I will be migrating. |
No issues with momentjs but it's deprecated. |
Same issue here. Switching back to momentjs for now :( |
I believe moment has the same issue: see this problem here: https://stackoverflow.com/questions/71421582/moment-returning-an-invalid-date-while-using-hermes-js-engine. |
This caused by hermes; follow this issue: facebook/hermes#865 |
I'm currently using moment and so far he's working fine. |
We were dealing with this in our codebase and I was able to fix by patching a few lines of the dayjs/timezone plugin code. Here is the fix. Hopefully it can be merged! |
Describe the bug
When I try convert date to select timezone, I got 'Invalid date'.
I know that we can use polyfill from this thread but it's look terrible.
got:

Expected behavior
Timezone is working on react-native
Information
The text was updated successfully, but these errors were encountered: