Created
April 13, 2020 19:32
-
-
Save romicofre/5be6dc1d0f4e3736a2ad517d05c27eca to your computer and use it in GitHub Desktop.
Convert date string format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fecha = "20200413191418" | |
objeto_fecha = datetime.strptime(fecha, '%Y%m%d%H%M%S').strftime('%Y-%m-%dT%H:%M:%S') | |
print(objeto_fecha) | |
print(type(objeto_fecha)) | |
#result: | |
# 2020-04-13T19:14:18 | |
# <class 'str'> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment