Skip to content

Instantly share code, notes, and snippets.

@drgarcia1986
Created March 28, 2014 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drgarcia1986/9834938 to your computer and use it in GitHub Desktop.
Save drgarcia1986/9834938 to your computer and use it in GitHub Desktop.
Exemplo básico de como trabalhar com os métodos strptime e strftime da biblioteca datetime do python
__author__ = 'diego.garcia'
import datetime
dt = datetime.datetime.strptime('February 28, 2014, 7:05 AM', '%B %d, %Y, %I:%M %p')
print(dt.strftime("%d/%m/%Y %I:%M %p"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment