moment-timezone: Problem with tz methods and daylight change in America

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) or moment().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.

Screenshot 2023-03-16 at 10 21 38 Screenshot 2023-03-16 at 10 23 53

Do you know If I’m missing something or a way to fix this? Thank you very much!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 17 (4 by maintainers)

Most upvoted comments

您的邮件已收到,我会尽快给您回复。