0

Consider the following python snippet:

import datetime
import pytz

iniTS =  datetime.datetime.strptime('08:00:00-00:00', '%H:%M:%S%z')

print("America/Bogotá offset: ", datetime.datetime.now(pytz.timezone('America/Bogota')).strftime('%z'))
print("Original Hour: ", iniTS)
print("Adjusted Hour: ", iniTS.astimezone(pytz.timezone('America/Bogota')))

I am getting this result:

America/Bogotá offset:  -0500
Original Hour:  1900-01-01 08:00:00+00:00
Adjusted Hour:  1900-01-01 03:04:00-04:56

I cannot figure out why am I receiving an offset of -04:56 instead of -05:00.

If someone can give me a light, I will really appreciate that.

Daniel Lema
  • 324
  • 2
  • 9
  • Maybe this answers your question? [Python pytz timezone function returns a timezone that is off by 9 minutes](https://stackoverflow.com/questions/35462876/python-pytz-timezone-function-returns-a-timezone-that-is-off-by-9-minutes#35779449) – jfaccioni Feb 07 '20 at 20:06
  • Does this answer your question? [Python pytz timezone function returns a timezone that is off by 9 minutes](https://stackoverflow.com/questions/35462876/python-pytz-timezone-function-returns-a-timezone-that-is-off-by-9-minutes) – realr Feb 07 '20 at 21:56

1 Answers1

1

Colombia adopted GMT-5 until 1914-11-22, before that date the hour in Bogota was latitude time instead of timezone (UTC -4:56:16).

If you include the year you'll see the right time

See Time Changes in Bogota Over the Years