[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

Alexander Belopolsky report at bugs.python.org
Wed Aug 16 19:00:16 EDT 2017


Alexander Belopolsky added the comment:

> It still seems like this shouldn't give an error (especially when the timezone of the local machine is UTC)

This is the part where I agree with you.  I suspect the error in the UTC case is an artifact of PEP 495 fold calculations that require probing times ±24 hours around the time being converted.  For the times before timezones were invented (late 1800s?) we can safely assume that fold=0 always.  To be safe, I would set the fold cut-off at the year 1000.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31212>
_______________________________________


More information about the Python-bugs-list mailing list