Skip to content

Instantly share code, notes, and snippets.

@hdelei
Created June 9, 2020 20:44
Show Gist options
  • Save hdelei/7cabc548ffa43ee7ea4153f2748998d0 to your computer and use it in GitHub Desktop.
Save hdelei/7cabc548ffa43ee7ea4153f2748998d0 to your computer and use it in GitHub Desktop.
Time shifts
def check_time(start, stop, current):
if stop < start:
print('stop < start')
if start < current < 2359 or 0 < current < stop:
print('start < current < 2359 and 0 < current < stop')
return True
else:
print('start < current < 2359 and 0 < current < stop')
return False
if start < current < stop:
print('start < current < stop')
return True
print('Time out of range')
return False
start = 2300
stop = 459
current = 2301
print(check_time(start, stop, current))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment