Skip to content

Instantly share code, notes, and snippets.

@hdelei

hdelei/time_diff.py

Created Jun 9, 2020
Embed
What would you like to do?
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