Skip to content

Instantly share code, notes, and snippets.

@shahifaqeer
Created October 9, 2013 21:42
Show Gist options
  • Save shahifaqeer/6908963 to your computer and use it in GitHub Desktop.
Save shahifaqeer/6908963 to your computer and use it in GitHub Desktop.
function to check sample timestamp and mark if in outage or not
#For October 1, 2012 to April 30, 2013 - remove all server side outages
def check_outage(a):
exc = 0
#October
if a > datetime(2012, 10, 10, 6, 45) and a < datetime(2012, 10, 10, 11, 0):
exc = 1
if a > datetime(2012, 10, 13, 5, 0) and a < datetime(2012, 10, 13, 6, 30):
exc = 1
#November
if a > datetime(2012, 11, 3, 21, 57) and a < datetime(2012, 11, 3, 22, 0, 20):
exc = 1
if a > datetime(2012, 11, 7, 9, 0) and a < datetime(2012, 11, 7, 10, 0):
exc = 1
if a > datetime(2012, 11, 18, 16, 0) and a < datetime(2012, 11, 18, 21, 0):
exc = 1
#December
if a > datetime(2012, 12, 18, 16, 45) and a < datetime(2012, 12, 18, 20, 45):
exc = 1
if a > datetime(2012, 12, 21, 7, 15) and a < datetime(2012, 12, 21, 9, 15):
exc = 1
#January
#February
if a > datetime(2013, 2, 6, 8, 37, 14) and a < datetime(2013, 2, 6, 8, 57, 57):
exc = 1
if a > datetime(2013, 2, 12, 14, 29, 7) and a < datetime(2013, 2, 14, 16, 48, 19):
exc = 1
if a > datetime(2013, 2, 20, 18, 9, 20) and a < datetime(2013, 2, 20, 20, 57, 17):
exc = 1
#March
#April
if a > datetime(2013, 4, 24, 17, 0) and a < datetime(2013, 4, 25, 17, 0):
exc = 1
return exc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment