Skip to content

Instantly share code, notes, and snippets.

@Diederikjh
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Diederikjh/487192821720c52be055 to your computer and use it in GitHub Desktop.
Save Diederikjh/487192821720c52be055 to your computer and use it in GitHub Desktop.
Check if time is in WebAfrica afterhours download time.
#!/usr/bin/python
import datetime
import sys
now = datetime.datetime.now()
nowTime = now.time()
downloadTimeStart = datetime.time(0,0)
downloadTimeEnd = datetime.time(6,0)
if nowTime > downloadTimeStart and nowTime < downloadTimeEnd :
# In download time, exit with 0
sys.exit(0)
else:
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment