• (nodebb)

    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...)

  • Rob (unregistered)

    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.

  • Brian (unregistered)

    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...

  • Zed (unregistered)

    OK but who is sending DHL parcels at 02:00? enough of them that it's worth keeping the place open?

  • Tim (unregistered) in reply to Zed

    I was wondering whether in the US an unqualified "2" could mean either 02:00 or 14:00

  • Scott (unregistered)

    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.

  • (nodebb) in reply to Tim

    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.

  • (nodebb)

    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.

  • MaxiTB (unregistered)

    Only timestamps matter. As in date+time in UTC. Problem solved. No more datetime issues ;-)

  • (nodebb)

    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:

    1. Shipping dept received shipment
    2. Shipping dept sent USPS the pre-shipment info
    3. Shipping label created
  • Sou Eu (unregistered) in reply to Tim

    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.

  • Barry Margolin (github)

    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.

  • (nodebb) in reply to Sou Eu

    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.

  • WTFGuy (unregistered)

    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.

  • Foo AKA Fooo (unregistered) in reply to Rob

    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.

  • markm (unregistered)

    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.

Leave a comment on “No Time Like the Past Future Present”

Log In or post as a guest

Replying to comment #:

« Return to Article