-
Notifications
You must be signed in to change notification settings - Fork 836
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
Wrong timezone for China/Schanghai #517
Comments
Would this be the same as #503? |
Can you please tell me what you get in your browser debug console for: console.log(Intl.DateTimeFormat().resolvedOptions().timeZone); Also, can you tell me if you have modified your printenv TZ |
That is really bizarre. You should get Are you on the current release of Chrome? Can you give me the result of Can you try to update and see if you still have the problem? |
And again, what does |
Oh sorry, i've overseen your comment about
In FF Ubuntu version 16.04.2 and 17.04 This might be an issue of the Ubuntu though, |
Ok, so with the Intl API returning strange results, there's not a lot Moment-timezone can do... Still I want to dig deeper on this to see if I can figure out what's going on. I need to take the time to spin up some of this environment to try to reproduce your results. My guess is it has to do with ICU version. IDK if libicu is distributed independently or just with Chrome. I'll leave this open for now until I can figure it out. |
It is no blocking issue for me, so that works perfectly fine. Thank you very much for caring! |
Hi, we run into the same issue. The problem is indeed a bug in libicu: http://bugs.icu-project.org/trac/ticket/12770 just my 2¢ |
I encountered this issue too, on Chrome 60, 61 for Mac, I found if I switch timezone to another timezone and then switch back, Seems it only appeared when |
A user of mine is encountering this same problem in an Electron app (I don't know what version of Chrome is uses).
|
I have the same problem in QQBrowser. I'm in China. The user agent is
|
If that's the correct version number, this is too old -- as it was released 2016-01-20. AFAICS, QQBrowser's latest version is 10, which uses Chrome 63. Try to upgrade. |
wrong time for added: sorry, it seems to be a bug of the implementation of |
Since there is a single time offset in entire China when using moment library for different time zones (based on PHP entires) like: {code} even though they should be UTC +8 there is +8:00 and +6:00 because of geo offset |
@mbm-rafal this is a completely different problem, right? Would you please open a new issue? |
I'm having this same issue with electron v2.0.5. In Chrome, I get what I would expect.
However in Electron, it's wrong.
The interesting thing is that the UTC offset is correct, but the timezone label is wrong. If I skip this line and let moment do the timezone guessing, I actually get the correct timezone. moment-timezone/moment-timezone.js Line 337 in c377ac8
Perhaps we should consider the native timezone logic unreliable, especially since what we're really after is UTC offsets for computing the correct dates... I would like to just skip the native call to
|
…I being unreliable. moment#517
OMG. Pacific Standard Time and Philippines Standard Time also have the same abbreviation -- PST! |
any news? |
I don't think moment-timezone uses offset names (PST, CST) to determine which timezone you're in. It uses offsets (the numbers) of different dates, and tries to match that to existing timezones. It's cool to debug libicu from moment-timezone, but not really the right place for it. Check #873 (comment) If we had way to tell guess to not use Intl at least we could close issues that are based on buggy Intl support (and shield users from them...). |
According to wiki
The abbr. CST stands both for Central Standard Time (North America) and China Standard Time
If you set your timezone on your PC to Shanghai, moment determines timezone:
America/Chicago
System
Ubuntu, FF or Chrome
"moment": "2.18.1", "moment-timezone": "0.5.13"
The text was updated successfully, but these errors were encountered: