Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 23, 2020 16:18
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/b24c4580d3ce3bd5a8e9b944d1bde2fb to your computer and use it in GitHub Desktop.
Save parzibyte/b24c4580d3ce3bd5a8e9b944d1bde2fb to your computer and use it in GitHub Desktop.
from datetime import datetime
from datetime import timedelta
# Ahora sumar algunas horas. Vamos a parsear la fecha:
fechaCadena = "2020-04-22 00:00:00"
ahora = datetime.strptime(fechaCadena, '%Y-%m-%d %H:%M:%S')
print("Ahora: " + str(ahora))
dentro_de_1_hora = ahora + timedelta(hours=1)
print("Dentro de una hora: " + str(dentro_de_1_hora))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment