更新 随机选人-tk - 作业版-s.py

This commit is contained in:
people 2023-10-30 16:17:12 +08:00
parent e5da8b389a
commit 3e6e4fc9ce

View File

@ -241,9 +241,12 @@ def rest():
listindes = sheet.col_values(index) listindes = sheet.col_values(index)
for x in range(1, len(listindes)): for x in range(1, len(listindes)):
a = listindes[x].split('-') a = listindes[x].split('-')
try:
start_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + a[0], '%Y-%m-%d%H:%M') start_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + a[0], '%Y-%m-%d%H:%M')
end_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + a[1], '%Y-%m-%d%H:%M') end_time = datetime.datetime.strptime(str(datetime.datetime.now().date()) + a[1], '%Y-%m-%d%H:%M')
now_time = datetime.datetime.now() now_time = datetime.datetime.now()
except:
return False
if start_time < now_time < end_time: if start_time < now_time < end_time:
return True return True
return False return False