Hacker News new | ask | show | jobs
by makecheck 3085 days ago
You’ll probably never see a flight or a movie or something start right at 12:00; it’s just so much clearer at a glance to see that 11:55 AM/PM.
4 comments

A while back I wrote a calendaring application where I encountered a similar problem and came up with a similar solution. If someone scheduled an all day meeting that ended at 12 midnight, the calendar would show it as a two-day meeting. The meeting started at 12AM on January 8th and ended at midnight of the same day... but since January 8th ends at 11:59PM and January 9th begins one minute later, the invite would roll over and be displayed as ending the next day. I'm not actually a real programmer (I just pretend to be one when someone wants to pay me) so this took way longer to figure out than it really should have.

I tried various things like if a meeting says 12AM, subtract one day, but then I'd encounter edge cases like meetings that start at 12AM now showing the previous day, or meetings that are scheduled from 12AM on the 8th to 12AM on the 8th (basically zero-minute durations) showing the wrong day or a bunch more things you don't think of until you try to develop applications for end users you might never talk to.

Eventually I set it to make any meeting that ended at 12AM just subtract one minute from the overall duration so it would end at 11:59PM instead. It didn't as much solve the problem as it did just avoid it, but at least people stopped complaining.

Time is hard.

Doing it right is really hard.

Whether this is measuring time or calculating time, it's hard.

I think trains in Britain avoid being scheduled to leave at 00:00, it's easy enough to leave at 23:59 at that time. It's not busy. But 12:00 wouldn't be ambiguous, since that can't be 00:00 or 24:00.

It would be pronounced "twelve hundred hours" by the automated announcement systems, and 12 o'clock by people.

Example of leaving at 5:00 (a minute in) https://youtube.com/watch?v=0cg-n-GF38E

00:01 is announced as "midnight oh one". ("The train on platform nine and three quarters is the midnight oh one service to Hogsmeade, calling at Hogsmeade only. A buffet trolley of drinks and light refreshments is available on this train.")

In fact, if you look within the next 27 minutes, the departure board for Clapham Junction has most minutes around midnight, but not midnight itself.

https://traintimes.org.uk/live/CLJ

Only trains to Georgia
But special sales at stores and online do begin at midnight. Say new playstation, iPhone, Xbox, etc.
Well, it's not ambiguous what the word "midnight" means.
It is, when it's attached to a day - it could be at the very beginning of that day or the very end.
Friday Midnight is the same as Midnight Saturday Morning.

I mean there is no standards committee for this, but that's what common convention tells us in the Anglophone part of the world.

Is "midnight 1st January 2017" unambiguous? Would it be in a legal document?

I've often enough seen "1st January 2017, 11:59 pm" or, even worse, "1st January 2017, 12:01 am" for deadlines etc.

Would you rely on common conventions in a legal document rather than legally defined terms?