Skip to content

Instantly share code, notes, and snippets.

@mejarc
Created January 5, 2013 01:04
Show Gist options
  • Select an option

  • Save mejarc/4458988 to your computer and use it in GitHub Desktop.

Select an option

Save mejarc/4458988 to your computer and use it in GitHub Desktop.
How many hours from now? A calculator for scheduling Buffer or Talentopoly posts. Relies on old-fashioned `raw_input`, but can be easily updated to Python 3.
from datetime import datetime
now = datetime.now()
print "Today is: ", now.strftime('%a, %d, %h %Y')
how_many_days = raw_input("How many days from now should this post? ")
print how_many_days
how_many_hours = (int(how_many_days)) * 24
print "This is %d hours." % how_many_hours
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment