Hello everyone,
I just stumbled upon a slight rounding error when working with the function absolutedate_to_datetime() (in pyhelpers.py). The error is only of one millisecond but caused some sanity checks in the code I am using to fail, which can be quite annoying.
For instance, when converting 31.526168 seconds to seconds and microseconds, the function returns 31 seconds and 526167 micreseconds (because in Python, 31.526168 - 31 = 31.52616799999… and the function truncates the decimal part instead of rounding it off)
A suggestion would be to replace line 121 of pyhelpers.py :
microseconds = int(1000000.0 * (seconds - math.floor(seconds)))
by something like
microsecond = int(round(second - int(second), 6))
Best regards,
Alexandre