Skip to content

Instantly share code, notes, and snippets.

@erochest
Created May 29, 2015 13:29
Show Gist options
  • Save erochest/a8e9832f1c60dee0556c to your computer and use it in GitHub Desktop.
Save erochest/a8e9832f1c60dee0556c to your computer and use it in GitHub Desktop.
import datetime
input_time = 'Fri May 29 09:23:40 EDT 2015'
parsed = datetime.datetime.strptime(input_time, '%a %b %d %H:%M:%S %Z %Y')
print(parsed.toordinal())
# 735747
print(str(parsed))
# 2015-05-29 09:23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment