时间戳转时间:fromtimestamp
>>> import datetime
>>> datetime.datetime.fromtimestamp(1557397096)
datetime.datetime(2019, 5, 9, 18, 18, 16)
时间转字符串:strftime
>>> d = datetime.datetime.fromtimestamp(1557397096)
>>> d
datetime.datetime(2019, 5, 9, 18, 18, 16)
>>> d.strftime("%Y-%m-%d %H:%M:%S")
'2019-05-09 18:18:16'
关注公众号「Python之禅」,回复「1024」免费获取Python资源