-
Notifications
You must be signed in to change notification settings - Fork 187
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
Bug: fn day_timestamp_micro
produces wrong results
#311
Comments
cc @liurenjie1024 |
Hi, @marvinlanhenke Thanks for the debug, yes we should align with java/python implementation carefully. The fix looks good to me. |
Do you mind to submit a pr to fix it? |
@liurenjie1024 |
@liurenjie1024 |
Yes, exactly. |
Description:
fn day_timestamp_micro
(source) seems to produce the wrong result which is off-by-one due to rounding errors.Also the implementation does not align with the Java implementation, which handles the conversion slightly different.
An example of the wrong output can be seen in the test:
-115200000000
evaluates to1969-12-30T16:00:00Z
which should be days -2 (since epoch) and not -1.Proposal:
Align Rust with Java implementation.
I already have a prototype, due to working on #264, so I will implement the fix in a different PR - so it can be verified more easily.
The text was updated successfully, but these errors were encountered: