python判断是否是零时

python判断是否是零时

 

from datetime import datetime

now = datetime.now()
if now.hour == 0 and now.minute == 0 and now.second == 0:
    print("It's midnight!")

 

 

 

################################

posted @ 2023-04-04 21:13  西北逍遥  阅读(74)  评论(0编辑  收藏  举报