将当前日期变为 年-月-日 时:分:秒 from datetime import datetime print(datetime.strptime(str(datetime.now()).split('.')[0],"%Y-%m-%d %H:%M:%S")) 如果觉得文章不错,可以分享给其他人哟~