Skip to content
Advertisement

adding tzinfo for naive datetime cause strange offset?

I’m just trying to add tzinfo for my datetime object (with no specific time). I have date in str format, and timezone in str format. I created this function:

JavaScript

all looks fine when I am using tzinfo like: “Etc/GMT-6”:

JavaScript

but look at this:

JavaScript

Why do I get such a strange values like 03:19, 05:18 when it should be 03:00, -05:00? It cause problems lately.

Advertisement

Answer

Ok, i dont know whats wrong with this, but i found solution using django make_aware:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement