603-arrow

arrow 则提供更简洁、人性化的日期时间操作 API。

PyPIhttps://pypi.org/project/arrow/

GitHubhttps://github.com/arrow-py/arrow

推荐使用datetime 推荐,arrow 按需推荐(更易用)。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import arrow

now = arrow.now()
print(now.format('YYYY-MM-DD HH:mm:ss'))

now.humanize()
# 'an hour ago'

now.humanize(locale='ko-kr')
# '한시간 전'