代码 import time stime = 1640693698.2191172 dtime = time.localtime(stime) dtime time.struct_time(tm_year=2021, tm_mon=12, tm_mday=28, tm_hour=20, tm_min=14, tm_sec=58, tm_wday=1, tm_yday=362, tm_isdst=0) print(time.strftime("%Y-%m-%d %H:%
代码
>>> import time>>> stime = 1640693698.2191172
>>> dtime = time.localtime(stime)
>>> dtime
time.struct_time(tm_year=2021, tm_mon=12, tm_mday=28, tm_hour=20, tm_min=14, tm_sec=58, tm_wday=1, tm_yday=362, tm_isdst=0)
>>> print(time.strftime("%Y-%m-%d %H:%M:%S", dtime))
2021-12-28 20:14:58
时间格式符