【发布时间】:2017-05-09 15:31:59
【问题描述】:
如何让 Arrow 返回两个时间戳之间的小时差?
这是我所拥有的:
difference = arrow.now() - arrow.get(p.create_time())
print(difference.hour)
p.create_time() 是当前正在运行的进程的创建时间的时间戳。
返回:
AttributeError: 'datetime.timedelta' object has no attribute 'hour'
编辑:我不想要所有三种格式的总时间,我想要它作为余数,例如。 “3 天 4 小时 36 分钟”而不是“3 天 72 小时 4596 分钟”
【问题讨论】:
-
@alecxe 请看我的编辑。
标签: python datetime arrow-python