参考博客: Python获取当前时间(time模块)_wk的博客-CSDN博客_python获取时间
import time time.time()
t = time.localtime() #time.struct_time(tm_year=2021, tm_mon=10, tm_mday=4, tm_hour=10, tm_min=5, tm_sec=17, tm_wday=0, tm_yday=277, tm_isdst=0)
time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()) #2021-10-04 10:10:13