[issue41321] Calculate timestamp is wrong in datetime.datetime

2020-07-20 Thread SilentGhost
Change by SilentGhost : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41321] Calculate timestamp is wrong in datetime.datetime

2020-07-20 Thread Paul Ganssle
Paul Ganssle added the comment: Hi dh4931 — this is the expected result, assuming that the offsets changed between those two dates in your system local time. The .timestamp() method returns an epoch time, which is the number of seconds since 1970-01-01T00:00:00 UTC, and so it is inherently

[issue41321] Calculate timestamp is wrong in datetime.datetime

2020-07-17 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Serhiy, you are right. I wrote below script that could explain the difference. # ../backups/bpo41321.py import datetime import zoneinfo for tz in zoneinfo.available_timezones(): diff = datetime.datetime(1986, 5, 4, 7, 13, 22,

[issue41321] Calculate timestamp is wrong in datetime.datetime

2020-07-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It depends on timezone. I guess there was a switch to daylight saving time at that time and place. -- nosy: +belopolsky, lemburg, p-ganssle, serhiy.storchaka ___ Python tracker

[issue41321] Calculate timestamp is wrong in datetime.datetime

2020-07-17 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I cannot reproduce the report on 3.8 and master. Both of the instances return 26002 which is 7 hours, 13 minutes and 22 seconds. Can you please attach a script that I can run to reproduce the difference? python3 Python 3.8.0 (v3.8.0:fa919fdf25,

[issue41321] Calculate timestamp is wrong in datetime.datetime

2020-07-17 Thread dh4931
New submission from dh4931 : like so datetime.datetime(1986, 5, 4, 7, 13, 22).timestamp() - datetime.datetime(1986, 5, 4, 0, 0, 0).timestamp() the result is 22402.0, the result is wrong. but on May 2nd datetime.datetime(1986, 5, 2, 7, 13, 22).timestamp() - datetime.datetime(1986, 5, 2, 0, 0,