获取当前时间,并将获取到的时间按照年-月-日 时:分:秒的格式打印输出。 import time t=time.gmtime() print(time.strftime('%Y-%m-%d %H:%M:%S',t))