小编Swe*_*ace的帖子

Arrow中时间戳的区别

我如何让Arrow返回两个时间戳之间的小时差异?

这就是我所拥有的:

difference = arrow.now() - arrow.get(p.create_time())
print(difference.hour)
Run Code Online (Sandbox Code Playgroud)

p.create_time() 是当前正在运行的进程的创建时间的时间戳.

返回:

AttributeError: 'datetime.timedelta' object has no attribute 'hour'
Run Code Online (Sandbox Code Playgroud)

编辑:我不想要所有三种格式的总时间,我希望它作为余数,例如."3天,4小时,36分钟"不是"3天,72小时,4596分钟"

python datetime arrow-python

8
推荐指数
1
解决办法
6403
查看次数

标签 统计

arrow-python ×1

datetime ×1

python ×1