Re:Excel warriors who save governments and companies from sp...
by askvictor on Friday October 16, 2020 @06:48PM
(#24805758)
Not just Excel; Google Sheets too. Our school system has student codes in the format ABC0001 where ABC is the first three letters of the surname, and the number is sequential. So a student with a surname Martin might get a code MAR0004. Which Sheets, in it's wisdom, decides to interpret as the date March 2004. Go figure.
[ Parent
| on HN ]
Re:Excel warriors who save governments and companies from sp...
by sciurus on Friday October 16, 2020 @10:23PM
(#24806983)
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.
Re:Excel warriors who save governments and companies from sp...
by ptx on Friday October 16, 2020 @11:51PM
(#24807356)
Not 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.
Re:Excel warriors who save governments and companies from sp...
by Moru on Saturday October 17, 2020 @11:13AM
(#24810552)
There 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...
Re:Excel warriors who save governments and companies from sp...
by fauigerzigerk on Saturday October 17, 2020 @03:13PM
(#24812381)
>01/02/03 has one order
It has one order in the U.S and a different one in most other countries.
Re:Excel warriors who save governments and companies from sp...
by icebraining on Saturday October 17, 2020 @09:11AM
(#24809710)
Can'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.
Re:Excel warriors who save governments and companies from sp...
by tijsvd on Saturday October 17, 2020 @02:01AM
(#24807752)
The age-old workaround for this used to be to type an apostrophe in front of the value, which forces Excel to interpret as text. IIRC that used to work in Google Sheets as well. Doesn't that trick work anymore?
Re:Excel warriors who save governments and companies from sp...
by qayxc on Saturday October 17, 2020 @08:15AM
(#24809406)
It does, but people are uneducated and think that just because something runs in the browser, it doesn't require training and knowledge to use properly...
Re:Excel warriors who save governments and companies from sp...
by Sharlin on Saturday October 17, 2020 @01:21AM
(#24807625)
Excel being the de facto standard, Sheets has to try to be compatible with it, quirks and all.
Re:Excel warriors who save governments and companies from sp...
by 2fast4you on Saturday October 17, 2020 @01:31AM
(#24807656)
Speaking of quirks, Excel still incorrectly assumes the year 1900 is a leap year. Even Excel has to try to be compatible with Excel.
https://docs.microsoft.com/en-us/office/troubleshoot/excel/w...
Re:Excel warriors who save governments and companies from sp...
by phonon on Saturday October 17, 2020 @08:56AM
(#24809606)
You think that's bad...try to use a date function with a year before 1900...