Alexander Belopolsky added the comment: BTW, I was originally against introducing .timestamp() method and this issue illustrates why it is problematic: people use it without understanding what it does. If you want the distance between datetime.min and datetime(1970,1,1) in seconds - compute it explicitly:
>>> (datetime.min - datetime(1970,1,1)) / timedelta(0, 1) -62135596800.0 If you don't want to loose precision is roundtriping between datetimes and numbers - use microseconds: >>> (datetime.min - datetime(1970,1,1)) // datetime.resolution -62135596800000000 It is perfectly fine to work with naive datetimes and ignore the timezone issues when all your timestamps are in one timezones, but if you choose to ignore timezones - don't use .timestamp(). ---------- _______________________________________ 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