方法一:
打印日期
datetime.date.today()
返回的结果是 2021-11-19
方法二:
打印时间戳不被转成数字的方法
time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
结果是
方法三:
time.time()
结果是1232459293.2412
*数值型时间转换为日期时间
temp = 1640304060000
timeArray=time.localtime(int(temp/1000))
otherStyleTime=time.strftime('%Y-%m-%d %H:%M:%S',timeArray)
print(otherStyleTime)