📌  相关文章
📜  人类可读的时差python代码示例

📅  最后修改于: 2022-03-11 14:46:16.995000             🧑  作者: Mango

代码示例1
# pip install humanize
import humanize

date = datetime(2021, 6, 2, 8, 15, 0)
now = datetime.now()

humanize.precisedelta(date - now, minimum_unit="seconds", format="%d")
# '9 hours, 28 minutes and 59 seconds'