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
parseZone() not parsing UTC correctly #3463
Comments
Yep. That's wrong. I'll maybe see if I can't tackle that one tonight, I think I know where it happened. |
Is this maybe related? I tested with with 2.15.1 too: t = moment().toISOString();
console.log(t.toString());
parsed = moment.parseZone(t);
console.log(parsed.toISOString()); Outputs:
My local time is "Europe/Vienna" and thus I know where the 2 hour difference probably comes from but I don't see why it should do it. With 2.14.1 I get the expected output:
|
PR handles the issue I believe - #3504 - Please let me know if its just flat wrong. @maggiepint |
I can confirm that it fixes my problem from #3463 (comment) |
#3504 just got labeled a bug fix w00t! |
[tests] Fixes #3463, parseZone not handling Z correctly (tests only)
On latest version (2.15.1), parseZone() seems not working correctly when offset is utc.
moment.parseZone('2016-05-04T00:00:00Z').format()
=> "2016-05-04T08:00:00Z" bad
moment.parseZone('2016-05-04T00:00:00+08:00').format()
=> "2016-05-04T00:00:00+08:00" good
The method was good on 2.14.1, I recently updated moment.js to 2.15.1 and the new version failed my test case.
The text was updated successfully, but these errors were encountered: