python3 生成时间字符串 Posted on 2018-12-26 Edited on 2024-05-21 生成对应格式的时间字符串1234import timecurrent_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())print(current_time) 结果: 12018-12-26 14:27:26