-
Notifications
You must be signed in to change notification settings - Fork 7
Broken fidelity on datetime.fromtimestamp() #5
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
Comments
Ok, found out that #4 beat me to the punch on this one. I was comparing with the precompiled version of adafruit_datetime from several days ago, so didn't catch this change. Leaving this here, however, as in the integer case my version avoids an unnecessary conditional and round call, but functionally they are identical so this can be abandoned if you do not feel that it is worth it otherwise. |
@jepler What do you think? |
Made updates to the PR per code review |
Thank you! |
Using datetime.fromtimestamp() is returning incorrect results due to a loss of precision in the underlying EPOC time. This causes the time to return the same result for multiple seconds, and then "jump", making the seconds value not reliable.
Tested on FeatherS2 and Raspberry Pi Pico.
Steps to reproduce:
(observe the time not change second to second)
The text was updated successfully, but these errors were encountered: