2 ms·
> Too many modules: datetime, time, calendar, dateutil, pytz and more Worse...too many modules included in the standard Python library with slightly incompatib
by tzs 6y ago
> Too many modules: datetime, time, calendar, dateutil, pytz and more
Worse...too many modules included in the standard Python library with slightly incompatible implementations of the same functions.
I spent quite a while trying to understand why strptime was not working like I thought it should, before figuring out that I was using time.strptime when I should have been using datetime.strptime.
The difference that got me was that time.strptime was ignoring timezones in the format string and input string and assuming the local timezone. It was not an error to include %z in the format string and give it a time string that includes a timezone. It would simply silently be ignored and the local timezone used instead.