Python gets the current system time

python get current system time

import datetime
time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(time)

# 结果
# 2019-07-31 19:08:17

Guess you like

Origin www.cnblogs.com/17vv/p/11278480.html
Recommended