-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Incorrectly parsing input quasi UTC #24
Comments
Hi, thanks for this. I need to test against MomentJS itself to see if this is an upstream bug or not. A quick test shows that it is the 6th decimal place on the seconds value that causes the issue. Reduced to 5 is no problem. Will now test with raw moment. |
OK, got it. It is an upstream bug in moment-parseformat. I use that so as to give the widest possible chance at parsing inputs in different formats. But it produces weird outputs beyond 3dp:
Reported upstream: But I'm not hopeful of a resolution since there are many other outstanding issues back to 2016. |
Thanks for the investigation and the follow up! |
Clearly the upstream author is not willing to fix this issue so I will add a work-around to limit the number of decimal places. Added to backlog and a fix will be provided in an upcoming release. |
Workaround added to next release. |
I have been passed a string:
2019-05-25T15:30:42.526058+00:00
When passing this wholesale through the moment node I get this output:
2019-02-27T15:30:42.526Z
If I manipulate the string:
str.substring(0,23) + "Z"
That fixes it.
I'm posting the issue here primarily because I'm not sure how the moment node passes the string to the moment library, so am not sure where the bug is (if its a bug at all - the input timestamp does look legitimate enough).
The text was updated successfully, but these errors were encountered: