Reading cells with certain date time values causes non-integer results in seconds
version 3.0.3
When a date time is stored in a cell it is converted to a floating point number with limited precision.
When that date time is converted back to a date time value rounding errors occur.
For example: 2013-01-13 07:57:35 is converted to 41287.3316550926 and when it is converted back to a date time it becomes 2013-01-13 07:57:35.000001
In the code that converts the floating point to a date time, the following conversion causes the rounding error:
https://foss.heptapod.net/openpyxl/openpyxl/-/blob/branch/default/openpyxl/utils/datetime.py#L91
diff = datetime.timedelta(days=fraction)
If this is changed to:
diff = datetime.timedelta(seconds=round(fraction * 24 * 60 * 60))
the rounding error is gone.
Not sure if this is a good idea in practice in case there are time stamps with fractional seconds.