Skip to content
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

guess() breaking change with node 10 #693

Open
feugy opened this issue Oct 29, 2018 · 3 comments
Open

guess() breaking change with node 10 #693

feugy opened this issue Oct 29, 2018 · 3 comments

Comments

@feugy
Copy link

feugy commented Oct 29, 2018

Hello!

We recently experienced a "breaking" change while upgrading to latest Node.js:

$ nvm use v8.11.1
Now using node v8.11.1 (npm v5.6.0)

$ TZ=Universal node -e "const m = require('moment-timezone'); console.log(m.utc().tz(m.tz.guess()).zoneAbbr())"
UTC

$ TZ=Universal node -e "const m = require('moment-timezone'); console.log(m.tz.guess())"
Etc/UTC



$ nvm use v10.12.0
Now using node v10.12.0 (npm v6.4.1)

$ TZ=Universal node -e "const m = require('moment-timezone'); console.log(m.utc().tz(m.tz.guess()).zoneAbbr())"
GMT

$ TZ=Universal node -e "const m = require('moment-timezone'); console.log(m.tz.guess())"
Africa/Abidjan

In both cases, the intlName returned by rebuildGuess() is 'UTC', but I found that userOffsets() returns something completely different:

# node 10
[ OffsetAt { at: 1451606400000, abbr: undefined, offset: 0 },
  OffsetAt { at: 1451606400000, abbr: undefined, offset: 0 },
  OffsetAt { at: 1467331200000, abbr: undefined, offset: 0 },
  OffsetAt { at: 1483228800000, abbr: undefined, offset: 0 },
  OffsetAt { at: 1498867200000, abbr: undefined, offset: 0 },
  OffsetAt { at: 1514764800000, abbr: undefined, offset: 0 },
  OffsetAt { at: 1530403200000, abbr: undefined, offset: 0 },
  OffsetAt { at: 1546300800000, abbr: undefined, offset: 0 },
  OffsetAt { at: 1561939200000, abbr: undefined, offset: 0 } ]
# node 8
[ OffsetAt { at: 1451606400000, abbr: 'UTC', offset: 0 },
  OffsetAt { at: 1451606400000, abbr: 'UTC', offset: 0 },
  OffsetAt { at: 1467331200000, abbr: 'UTC', offset: 0 },
  OffsetAt { at: 1483228800000, abbr: 'UTC', offset: 0 },
  OffsetAt { at: 1498867200000, abbr: 'UTC', offset: 0 },
  OffsetAt { at: 1514764800000, abbr: 'UTC', offset: 0 },
  OffsetAt { at: 1530403200000, abbr: 'UTC', offset: 0 },
  OffsetAt { at: 1546300800000, abbr: 'UTC', offset: 0 },
  OffsetAt { at: 1561939200000, abbr: 'UTC', offset: 0 } ]

When setting a different timezone with TZ env variable, results are consistent.

Any clue?
(I'm working from Europe/Paris, but friend from Europe/London is experiencing the same).

@feugy
Copy link
Author

feugy commented Nov 5, 2018

Up?

@rnegron
Copy link

rnegron commented Nov 29, 2019

We are running into this issue as well. Any news?

@ichernev
Copy link
Contributor

Is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants