Created
April 23, 2020 16:18
-
-
Save parzibyte/b24c4580d3ce3bd5a8e9b944d1bde2fb to your computer and use it in GitHub Desktop.
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
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