2 ms·
This misses what the change actually is. Python has two datetimes, one which includes the timezone info and one which doesn't (naive). There is no assumed time
by Spivak 3y ago
This misses what the change actually is. Python has two datetimes, one which includes the timezone info and one which doesn't (naive).
There is no assumed timezone for naive datetimes and different software treats it differently. What's being deprecated is methods to create naive datetimes that are implicitly UTC without just attaching that information to the object itself. In the new world everything is still in UTC and you convert to local time at the last minute but now you can be sure that the datetime object you got handed is actually UTC instead of it being a convention that isn't always honored.