【Python】得到当前日期时间 import time str=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) print(str)