Last active
August 29, 2015 14:06
-
-
Save Diederikjh/487192821720c52be055 to your computer and use it in GitHub Desktop.
Check if time is in WebAfrica afterhours download time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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