This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: datetime.timestamp() lose precision when the time is too large
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.11, Python 3.10, Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: yilei
Priority: normal Keywords:

Created on 2022-01-25 21:33 by yilei, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg411676 - (view) Author: Yilei Yang (yilei) * Date: 2022-01-25 21:33
Examples:

>>> datetime.datetime(2222, 1, 1, microsecond=999999).timestamp()
7952371200.999999
>>> datetime.datetime(3333, 1, 1, microsecond=999999).timestamp()
43012195201.0
>>> datetime.datetime(2567, 1, 1, microsecond=999998).timestamp()
18839548800.999996

I believe this is an issue caused by using `double` in the C implementation.
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90683
2022-01-25 21:33:20yileicreate