import time str=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) print(str) 转载于:https://www.cnblogs.com/xiandedanteng/p/8810480.html