【发布时间】:2019-09-13 21:58:53
【问题描述】:
在下面的示例中 - 我得到的秒值与微秒不匹配。这让我很困惑。有人能解释一下吗?
>>> a
datetime.datetime(2019, 9, 13, 21, 47, 46, 837435, tzinfo=<UTC>)
>>> b
datetime.datetime(2019, 9, 13, 21, 47, 54, 724570, tzinfo=<UTC>)
>>> (b-a).microseconds
887135
>>> (b-a).seconds
7
>>> (b-a)
datetime.timedelta(seconds=7, microseconds=887135)
【问题讨论】:
-
对我来说看起来是正确的。究竟哪些数字不匹配?
标签: python python-datetime timedelta