一、时间戳格式
import time
start = time.time()
print(start)
time.sleep(10)
end = time.time()
print(end)
print(end-start)
时间戳转正常时间网址
二、正常时间格式
import time
img_time = time.localtime(time.time())
img_normal_time = time.strftime("%Y_%m_%d_%H_%M_%S", img_time)
print(img_normal_time)
img_normal_time2 = time.strftime("%Y/%m/%d %H:%M:%S", img_time)
print(img_normal_time2)
三、datetime
import datetime
print(datetime.date.today())
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)