- 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
Frist of all, rolak's problem is caused by using just the time when calculating the difference. Drowning in a sea of lameness.
(1am tomorrow - 6am today) is not the same as (1am - 6am) (implied: both today, since no date is mentioned...)
Admin
I don't speak German at all, but are we absolutely sure the Paketshop didn't mean they are closed an average of 4.8 hours a day? That math works out, although I'm not sure why you'd display it as an average.
Admin
Given how "running past some hardcoded date" is a common category of bugs here, the last one makes a twisted kind of sense. Tune in 50 years from now when it inexplicably breaks...
Admin
OK but who is sending DHL parcels at 02:00? enough of them that it's worth keeping the place open?
Admin
I was wondering whether in the US an unqualified "2" could mean either 02:00 or 14:00
Admin
Rolak's one reminds me of the old joke from Car Talk:
Don't come in too late, you'll pass yourself leaving for the day.
Admin
I assume that in areas that use AM/PM times, 02:00 should be 14:00. If you really mean 2 in the morning, you should put am at the end.
Admin
I was looking at the calendar image, and I feel like they're using the date widget HTML5 allows without a max date, and the 50 years in advance is just a result of them not setting a max value for the field. The browser (or whatever widget they're using) has no context for what the date field is used for.
Admin
Only timestamps matter. As in date+time in UTC. Problem solved. No more datetime issues ;-)
Admin
The only WTF in the shipping one is the person who sent it in. They're listed in reverse order. Here, I'll clear it up:
Admin
Tim,
In Brazil, you can use just 2:00, but most Brazilians would clarify it as "2:00 da madrugada" (2:00 overnight), "2:00 da tarde" (2:00 in the afternoon), or go military with "14:00". Interestingly enough, when talking they don't include the extra 0, as in 02:00. Context is always key.
Admin
The airline negative delay error is also a case of the new time being in the next day.
It's hard to believe this happened, because airline programmers frequently have to deal with time periods that go into the next day, like red-eye flights.
Admin
And in France, it's always in 24-hour clock(1), from 00:00 to 23:59. (They recognise the concept of 2pm ==> "deux heurs de l'après-midi", but they don't use it.)
(1) Calling it "military time" is an Americanism. I'm not an American.
Addendum 2022-12-16 16:39: Ugh. Deux heures.
Bah.
Admin
Of course 24 hour clock conventions don't completely eliminate dumb over-midnight mistakes. An e.g. bar that opens at 1600 and closes at 0200 is actually open 10 hours. But computing
openDuration = closeTime - OpenTime
is figuring 0200 - 1600 = an openDuration of negative 14 hours. Oops.Admin
As a German, yes, we are sure. The average works out because each opening time wraps around midnight, so each difference, and therefore also the average is off by 24 hours, and of course, time closed is by definition 24 hours minus time opened.
As an occasional DHL customer, though, I don't see the WTF here. Negative opening hours definitely seem closer to reality than what (they seem to assume) was really meant here.
Admin
Germans (and most of the world except the USA) use a 24-hour clock, so there's no am or pm. In German "1:00" is unambiguously 1 hour after midnight. The WTF is programming a calculation that assumes the opening and closing times are in the same day. A simple plausibility check, or even just doing the calculation module 24 would avoid this. Westjet made the same erroneous calculation, and it's a bigger WTF because it had date information (departures must be date and time) but ignored the date.