def check_time(file_name):
while True:
now_localtime = time.strftime("%H:%M:%S", time.localtime())
# print(now_localtime)
# print(type(now_localtime))
if "01:00:00" < now_localtime < "23:30:00":
# if "20:10:00" < now_localtime < "23:30:00":
return True
else:
logger.info("{} 当前时间是 {} 不在 '01:00:00' ~ '23:30:00' 时间区间".format(file_name, now_localtime))
time.sleep(300)
python校验程序是否在指定时间访问内执行
最新推荐文章于 2024-11-04 10:51:20 发布