Skip to content

Instantly share code, notes, and snippets.

@nikolak
Created May 1, 2014 22:37
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 nikolak/d0de5edd78b9e57412bc to your computer and use it in GitHub Desktop.
Save nikolak/d0de5edd78b9e57412bc to your computer and use it in GitHub Desktop.
import datetime
import time
alarm = datetime.datetime(2014, month, day, hour, minute)
while True:
now = datetime.datetime.now()
diff = alarm - now
if diff.total_seconds() < 0:
print "Alarm triggered"
break
else:
print "{} seconds left to alarm".format(diff.total_seconds())
time.sleep(60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment