[New-bugs-announce] [issue45470] possible bug in datetime.timestamp()

Stefan report at bugs.python.org
Thu Oct 14 12:42:55 EDT 2021


New submission from Stefan <stefan at sriha.net>:

I noticed that there is a difference between intervals when computed from timedeltas vs timestamps. Is this a bug? Thanks!

In [2]: import datetime as datet
In [3]: d0 = datet.datetime(2016,3,27)
In [4]: d1 = datet.datetime(2016,3,28)
In [5]: (d1-d0).total_seconds()/3600
Out[5]: 24.0
In [6]: (d1.timestamp()-d0.timestamp())/3600
Out[6]: 23.0

----------
messages: 403917
nosy: stef
priority: normal
severity: normal
status: open
title: possible bug in datetime.timestamp()
type: behavior
versions: Python 3.9

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


More information about the New-bugs-announce mailing list