time strftime()接收时间元组,返回表示时间的字符串。字符串
time strptime()把时间字符串,解析成一个时间元组。import
import time im
t = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))时间
print(t)字符
print(time.strptime(t,'%Y-%m-%d %H:%M:%S'))time