打印当前时间方法

import time
 time.strftime('%Y-%m-%d__%H-%M-%S')




from datetime import datetime dt = datetime.now() print(f'今天是:{dt.year}年{dt.month}月{dt.day}日 {dt.hour}:{dt.minute}:{dt.second}') print(dt.strftime('今天是:%Y年%m月%d日 %H:%M:%S'))
posted @ 2022-04-25 14:13  hyd666kkk  阅读(124)  评论(0)    收藏  举报