Skip to content

Instantly share code, notes, and snippets.

@pontikos
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save pontikos/1b6bb2a949749c3c9786 to your computer and use it in GitHub Desktop.

Select an option

Save pontikos/1b6bb2a949749c3c9786 to your computer and use it in GitHub Desktop.
Format time given on stdin in format specified by first argument to stdout in format given by second argument.
import time
import sys
print time.strftime(sys.argv[2], time.strptime(sys.stdin.read().strip(), sys.argv[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment