- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Ref Remy's "The real WTF is that, somehow, this code worked at one time."
Said another way, the real WTF is that some version of mySql was silently converting datetimes like <2019-01-23T24:01:01> to be interpretted as <2019-01-24T00:01:01>.
Which is, as we all know, is the frist second of the frist minute of the frist hour of today. OBOB my butt! Fence posts!? I don't see no steenkin' fence posts!
Admin
At the same time, they earn approximately 4.17% more profit, and any operation they perform takes 4% less time (in relation to the duration of the day) compared to those poor people living in 24-hours-long-day world. If this is not an effective optimization, then I don't know what is...
Admin
We all want 25 hours in a day. These guys made it possible. If you dare, you can turn a want into a have.
Admin
I knew my days seemed much longer than they should.
Admin
Older versions of MySQL used to accept daft dates and times. I once committed a copy/paste error and inserted 31-Feb into a datetime column. It "helpfully" didn't throw an error and changed it to the 3rd of March.
Admin
Yeah, that sounds like MySQL. Terrible, terrible system. At least it's improved a bit.
Admin
So TRWTF is
a) MySQL suddenly breaking colossal quantities of applications which used to "work" and now crash?
or:
b) an off-by-one error not referred to as an OBOE, thereby making it impossible for someone who makes such a mistake counting, er, pink things, to be described as having committed a "pink OBOE"?
Which is it?
Admin
I still prefer the beatles with their eight days in a week.
Admin
I'd shorten it to "OBOBO". Just... seems more appropriate.
Admin
Better check the rest of this guy's code for instances where he assumes arrays start at 1.
Admin
This code should work eight days a week.
Admin
Most likely a change in the "strict" default setting, which seems to change depending on your MySQL version.
Admin
PHP and MySQL strike again!
Admin
They're just future-proofing the code. Once the Earth's rotation slows down enough in a few eons, the IERS will start inserting leap hours when needed, rather than those puny leap seconds we see nowadays.
Admin
You may jest, but I fear the IERS will simply "roll the hour back" same as is done when switching from DST to Standard Time.
I think we just need to redefine the ISO unit of time (second) so that we run thru 25*3600 = 9E4 seconds per day.
Admin
Centaurian time, standard 37-hour day. Give it a few months. You'll get used to it. Or you'll have a psychotic episode.
Admin
reminds me of a story where someone messed up the dates and made the first day of every month a ZERO!
Admin
There's an off by one error in your brain as well. 25/24 is not 104%, 26/25 is. Glass house, meet stones. Bonus stone for garden path sentence.
Admin
So. . .in the past a "Cust"omer_"update"_"enddate" occurred in 24 hours 59 minutes and 59 seconds from now. . .enough time for a human to scan the rest of the entered data fields and do something. . .but with the new version of MySQL there is no longer a tomorrow.
While the existing code is perhaps not the best way to specify a future date, I'll wager this functionality was a known MySQL thing that many developers took advantage of to avoid one of those hard date related calculations.
For a tongue in cheek viewpoint: In the past you received 72 hours to pay that parking ticket, but Acme Traffic Ticketing does not want to rewrite their entire code base for this MySQL update so now you have just 24:59 to pay that ticket, or receive additional fines.
♪♫♪ Tomorrow, tomorrow, You're always a day awayyyyyy
Admin
Depends on the language you're using.
Admin
My guess is the code only worked on Mondays.
Admin
...except for leap years
Admin
Could have been avoided if the convention of using half-open intervals to represent absolute time intervals were used (any given timestamp represents a period of time that starts at the instant indicated). Then something that starts at 2019-06-07 00:00:00.000 and runs for three days is indicated by adding ending at 2019-07-09 00:00:00.000 and not 2019-07-08 24:59:59.999.
Admin
I had hoped that was already the case, but have been dismayed by the increasing use of 12:01am and 11:59pm as start and end times for events that last for '24 hours'.
Admin
It is not uncommon, in Japan, to see that a mall will be open until 26:00, meaning 02:00 the next day.
Admin
so, developer went and upgraded the entire f***g OS and then bad st happened. man, didn't see that coming.
Admin
That's not a bug. Days should start at 6:00:00 and end at 29:59:59. The real WTF is incrementing the date when most people are awake.
Admin
I've looked at that many times, and I'm still sure that's only two days.
And yeah, it was a bit odd in Japan seeing 'Road closed: 21:00 - 28:00'
Admin
A pedant writes: if you're in a country that observes DST then on the two changeover days per year, one day will be 23 hours long, the other 25, though 24:59:59 will always be an invalid time.
Admin
25/24=1.041(6) => 1.04 to 2 d.p.
Admin
Shouldn't an off-by-one bug be acronymized as OBTB? Just to make what it is clear?