python获取系统时间

python获取系统时间:

from datetime import datetime

dt=datetime.now()
date=dt.strftime('%Y-%m-%d-%H-%M-%S')
print(date)

 

posted @ 2019-10-18 20:33  小大大小  阅读(835)  评论(0编辑  收藏  举报