Message300395
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(). |
|
Date |
User |
Action |
Args |
2017-08-16 22:47:55 | belopolsky | set | recipients:
+ belopolsky, vstinner, Dave Johansen |
2017-08-16 22:47:55 | belopolsky | set | messageid: <1502923675.64.0.361324007471.issue31212@psf.upfronthosting.co.za> |
2017-08-16 22:47:55 | belopolsky | link | issue31212 messages |
2017-08-16 22:47:55 | belopolsky | create | |
|