Created
June 10, 2018 00:57
-
-
Save Fhernd/36dcfc8549d57ca20597a122a060e809 to your computer and use it in GitHub Desktop.
Manipulación de fechas con zonas horarias. 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 datetime | |
from pytz import timezone | |
fecha = datetime(2013, 3, 14, 17, 23, 29) | |
print('Fecha base:', fecha) | |
bogota = timezone('America/Bogota') | |
bogota_fecha = bogota.localize(fecha) | |
print('Fecha Bogotá:', bogota_fecha) | |
singapur = timezone('Asia/Singapore') | |
singapur_fecha = bogota_fecha.astimezone(singapur) | |
print('Fecha Singapur:', singapur_fecha) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment