Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 20, 2018 00:10
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 parzibyte/0a22ef94959249d36a92082212616416 to your computer and use it in GitHub Desktop.
Save parzibyte/0a22ef94959249d36a92082212616416 to your computer and use it in GitHub Desktop.
Formatear fecha y hora actual en Python-1 created by parzibyte - https://repl.it/@parzibyte/Formatear-fecha-y-hora-actual-en-Python-1
"""
Formatear fecha actual de modo que su formato quede como:
"2018-19-12 18:08:50"
@author parzibyte
"""
from datetime import datetime
ahora = datetime.now()
fecha = ahora.strftime("%Y-%m-%d %H:%M:%S")
#Imprimir
print(fecha)
# 2018-12-20 00:10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment