Skip to content

Instantly share code, notes, and snippets.

@dario61081
Created March 9, 2018 18:25
Show Gist options
  • Save dario61081/66138b7cfe6eb549626e04cd60ab4187 to your computer and use it in GitHub Desktop.
Save dario61081/66138b7cfe6eb549626e04cd60ab4187 to your computer and use it in GitHub Desktop.
conversion de str to date
>>> datetime.strptime(cr_date, '%Y-%m-%d %H:%M:%S.%f')
datetime.datetime(2013, 10, 31, 18, 23, 29, 227)
>>> datetime.strptime(cr_date, '%Y-%m-%d %H:%M:%S.%f').strftime('%m/%d/%Y')
'10/31/2013'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment