Skip to content

Instantly share code, notes, and snippets.

@jpr71
Created May 9, 2016 19:51
Show Gist options
  • Save jpr71/5649b63486a346b570b87d830054d7bf to your computer and use it in GitHub Desktop.
Save jpr71/5649b63486a346b570b87d830054d7bf to your computer and use it in GitHub Desktop.
import datetime
current_time = datetime.datetime.now()
def nine_to_five_weekday(time):
if time.weekday() in range(0,5) and time.hour in range(9,17):
return 20
else:
return 80
print nine_to_five_weekday(current_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment