Alexander Belopolsky added the comment:

It your use case, the input "0001-01-01T00:00:00" was in what timezone?

I suspect what you want is 

>>> datetime.min.replace(tzinfo=timezone.utc).timestamp()
-62135596800.0

And not -62135658000.0.  If you work with naive datetimes and just want to 
roundtrip between datetimes and numbers, you should not use a 
timezone-dependent conversion - attach UTC timezone before calling .timestamp() 
as shown above.  You probably don't want your program to produce different 
numbers for the same "0001-01-01T00:00:00" input depending on where it is run.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31212>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to