4 ms·
Dates can be weird just about anywhere. I recently hit a bug where all data was being checked to see if it was a datetime, and python interpreted `st1` as Sep
by sciurus 6y ago
Dates can be weird just about anywhere.
I recently hit a bug where all data was being checked to see if it was a datetime, and python interpreted `st1` as September 1st of the current year.
https://github.com/mozilla/frost/pull/330 https://github.com/mozilla/frost/pull/330
- ptx 6y agoNot really Python as such, it seems, but rather some third party library[1] which promises "generic parsing of dates in almost any string format". This is impossible to do correctly (what is 01/02/03?) and usually a bad idea to attempt. [1] https://pypi.org/project/python-dateutil/ https://pypi.org/project/python-dateutil/
- Moru 6y agoThere is actually some standards here at least. 01/02/03 has one order, 01-02-03 another. The character between tells you how to read them. Not that most people know how though...
- fauigerzigerk 6y ago>01/02/03 has one order It has one order in the U.S and a different one in most other countries.
- icebraining 6y agoCan't say I blame python or even the library; why is the code even trying to convert every string in an object, instead of just the keys that are supposed to contain dates?! Seems like a poor hack, imho.