-
Notifications
You must be signed in to change notification settings - Fork 837
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 tz methods and daylight change in America #1042
Comments
I'm having trouble reproducing this, but I'm probably just missing some context. To clarify:
|
Thank you for answering @gilmoreorless!!! Yeah thats right, for me to test, it's easier if I move to the timezone that is having problems, so yeah, I'm basically changing the moment to the same timezone that I am. About the second question, I'm creating the original moment from the object in the screenshot doing this: |
Okay I've created the different test to see how it's the behaviour between the way of creating the original moment. |
Hrm that's interesting. I've tried those examples and still get To help diagnose this, can you give me the output of these 3 values? moment.version;
moment.tz.version;
moment.tz.dataVersion; I know you gave the version definitions in the opening description, but dependency weirdness doesn't always produce what we expect (here's a good example). Also, how are you including |
That's odd — your |
Heeeeeeeey @gilmoreorless, I managed to update the To add context, my application runs in Meteor framework, so I decided to do the next to see if it could fix the issue, it's probably no the best solution but it worked 😄.
After that I installed As Now if I run |
I've reverted the changes to do more testing and see where the problem was and looks like it was that Because if I run If I apply this change except of the one I sent in the message above, the thing is that I have installed |
Ah good to see you found the issue! Dependency problems are inconsistent in appearance, but consistently annoying. 😆 I haven't used Meteor before, so I'm not sure how its internal dependency mechanism works. Something to note, though, is that we're planning to remove the automatic dependency on |
Perfect, I'll install Thank you very much for everything @gilmoreorless. |
Just to add if someone with the same problem comes here, in order that this fix works, you have to install If you install first |
Hi @adrianmarinwork, I have the same issue and tried your solution, but it doesn't help. I found a temporary solution:
It will output:
|
您的邮件已收到,我会尽快给您回复。
|
this isnt working for me. |
Right now I'm using the |
Moment version which you use:
Version: "moment": "^2.29.4",
Moment-timezone version which you use:
Version: "moment-timezone": "^0.5.41"
Issue description:
Hello, this past 12 of March in America they changed from -5 to -4 because of the daylight change.
Looks like when I run
moment.tz(date, timezone)
ormoment().tz(timezone)
it's still using the old offset (-5) and the date returned is wrong.As an example, I'm from Spain and I've set my computer timezone to New York. As you will see in the screenshots, when I create the date with moment, it's using the correct offset, but when I use one of the methods mentioned above, it changes to the old offset, returning me a date that I don't want.
Do you know If I'm missing something or a way to fix this?
Thank you very much!
The text was updated successfully, but these errors were encountered: