把时间戳转化为标准时间

>>> import  datetime
>>> datetime.datetime.fromtimestamp(1698668998)
datetime.datetime(2023, 10, 30, 20, 29, 58)
>>> a=datetime.datetime.fromtimestamp(1698668998)
>>> print(a)
2023-10-30 20:29:58
>>> a.year
2023
>>> a.month
10
>>> a.day
30
>>> 
原文地址:https://www.cnblogs.com/luckiness/p/13294438.html