Skip to content

Instantly share code, notes, and snippets.

@dnmellen
Created January 15, 2015 12:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dnmellen/50d593fb26d904017d16 to your computer and use it in GitHub Desktop.
Save dnmellen/50d593fb26d904017d16 to your computer and use it in GitHub Desktop.
Seconds to the next day in python
from datetime import datetime, timedelta
print (datetime(*(datetime.now() + timedelta(days=1)).timetuple()[:3]) - datetime.now()).seconds
@gischio
Copy link

gischio commented Dec 16, 2015

Thanks for sharing this piece of code, you made my day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment