[issue45470] possible bug in datetime.timestamp()

Stefan report at bugs.python.org
Thu Oct 14 13:10:45 EDT 2021


Stefan <stefan at sriha.net> added the comment:

sorry it's resolved. it was a timezone issue:

In [2]: d0 = datet.datetime(2016,3,27,tzinfo=datet.timezone.utc)

In [3]: d1 = datet.datetime(2016,3,28,tzinfo=datet.timezone.utc)

In [4]: (d1-d0).total_seconds()/3600
Out[4]: 24.0

In [5]: (d1.timestamp()-d0.timestamp())/3600
Out[5]: 24.0

----------
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45470>
_______________________________________


More information about the Python-bugs-list mailing list