Created
June 5, 2018 12:19
-
-
Save Fhernd/ff0c23f67f29c61ff97daf8f6398538c to your computer and use it in GitHub Desktop.
Conversión de tiempo. OrtizOL.
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 timedelta | |
from datetime import datetime | |
tiempo1 = timedelta(days=5, hours=7) | |
tiempo2 = timedelta(hours=3.5) | |
tiempo3 = tiempo1 + tiempo2 | |
print(tiempo3.days) | |
print(tiempo3.seconds) | |
print(tiempo3.seconds / 3600) | |
print(tiempo3.total_seconds() / 3600) | |
print('') | |
tiempo1 = datetime(2018, 6, 5) | |
print(tiempo1 + timedelta(days=14)) | |
tiempo2 = datetime(2013, 4, 13) | |
tiempo3 = tiempo1 - tiempo2 | |
print(tiempo3.days) | |
print('') | |
ahora = datetime.today() | |
print(ahora) | |
print(ahora + timedelta(minutes=13)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment