我们有一个功能,可以将历元转换为日期时间对象,并在python中将它们格式化为字符串.此外,我们还希望将超出范围的纪元转换为datetime,并将其格式化为字符串.然而,python datetime对象不支持大日期,例如将格式设置为13/07/15589
日期的429790838400
.
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> dt = datetime.fromtimestamp(429790838400)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: year 15589 is out of range
有人能指导我们如何做到这一点吗?