打印当前时间:
import time """格式化成2016-03-20 11:45:39形式""" print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) '''# 格式化成Sat Mar 28 22:24:24 2016形式''' print (time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()))
打印当前时间:
import time """格式化成2016-03-20 11:45:39形式""" print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) '''# 格式化成Sat Mar 28 22:24:24 2016形式''' print (time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()))