Skip to content
Snippets Groups Projects
Verified Commit 9db347ae authored by Antoine Lambert's avatar Antoine Lambert
Browse files

postgresql/converters: Fix unexpected seconds rounding in db_to_date

hypothesis uncovered some edge cases datetime objects where Python will
produce a timestamp offset by one second due to an unexpected rounding,
likely due to float point precision issue during computation.

Set datetime microseconds to 0 before calling the timestamp method to
avoid such side effect and ensure converted date will be the same as
the input one.

Fixes #4720.
parent c2fd0f01
No related branches found
No related tags found
1 merge request!1167postgresql/converters: Fix unexpected seconds rounding in db_to_date
Pipeline #13339 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment