3 ms·
While I don't have a strong preference in this "war", I can think of an interesting argument for 1-based. Our time counting is 1-based. There is no zeroth seco
by IlliOnato 6y ago
While I don't have a strong preference in this "war", I can think of an interesting argument for 1-based.
Our time counting is 1-based. There is no zeroth second, zeroth minute, hour, day, month, year, or century.
This actually makes it slightly harder in 0-based languages to work with time and dates.
Also, it might be an indication that 1-based system is somewhat more intuitive to non-programmers.
- flukus 6y ago> There is no zeroth second, zeroth minute, hour, day, month, year, or century. No there isn't, but we still use 0 to denote the first minute of an hour, just as we use 0 to denote the first element of an array.
- wraptile 6y agoOur counting is 0-based as well - usually when you start by saying "one" it is implied that 1 second has elapsed. So while we don't pronounce zero we still count starting from it.
- hmry 6y ago> There is no zeroth second, zeroth minute, hour My clocks all start at 00:00:00 every day, and that seems entirely logical to me. It's also how all programming languages that I've worked with represent time.
- IlliOnato 6y agoBut 00:00:00 does not represent the first second of your day. It represents a _point_in time, which has no duration. The first second of your day is an interval between the moment your clock shows 00:00:00 and the moment it shows 00:00:01. If 00:00:00 is the fist second, why it's not the first minute and not the first hour? Is the fist second is the same as the first minute and the first second?
- vbarrielle 6y ago> Our time counting is 1-based. Not in every part in the world. Here in France, we use 24h time, and midnight is 00:00. Very convenient.
- OJFord 6y agoI'm not French, but your comment just made me 'realise' that people who use 12h have the largest numbers when we on 24h have the smallest, almost like the 'start' is one o'clock. Weird. Same :00 start happens with minutes on 12h though of course. I think GP didn't mean to talk about time, has a point regarding months as I replied elsewhere. We represent the months numerically as 1-12, and I have recently found that annoying to work with.
- vbarrielle 6y agoIndeed, months are 1 based, but it's never been a problem to eg compute which month it will be, say 9 months later: just sum and subtract 12, no need for a real modulo computation. It's probable I've never found it annoying because I don't need to perform this computation with more than 12 months.
- linknoid 6y ago12:00 should actually be 0:00 on the 12 hour clock, it belongs to the next 12 hour period. 11:59 PM is yesterday, 12:00 AM is one minute later, and falls on today. Same with noon, 12:00 PM comes one minute after 11:59 AM. When I see 12:00, I automatically convert that to 0:00, otherwise AM/PM doesn't make sense.
- IlliOnato 6y agoYeah, this is most familiar to me too. Still, I'd argue it's 1-based. 00:00 is a point in time, but the first second is between 00:00:00 and 00:00:01, and it's "00:00:01" when it has elapsed. No?
- IncRnd 6y agoThere absolutely is a zeroth second! It is the 60th second of the prior minute. This is actually the exact reason why midnight is 12 AM not 12 PM, and noon 12 PM not 12 AM. If there weren't a zeroth second, minute, hour, day, month, year, or century when was 12:00 AM of Jan 1, 2000? This is why a zero _offset_ is the initial _value_ for many implementations.
- IlliOnato 6y ago... And I (a non-native English speaker living in the US) always have trouble remembering what 12 AM and 12 PM means, even after all these years I have to look it up every time, and sometimes it drives me nuts. (For a moment I hoped your explanation would at least serve as a heuristics... but alas, it does not make sense to me. Well, at least at the moment I remember the notation). Regardless of it, "12:00 AM of Jan 1, 2000" is not a particular second. It's a point in time, it has no duration. It does not belong to any particular calendar hour or day or year, it's a _boundary_ between two. Of course it belongs to XX century since XXI century starts at 12:00 AM of Jan 1, 2001. The first second of Jan 1 lasts from 12:00::00 AM to 12:00:01 AM. First minute of that day lasts from 12:00 AM to 12:01 AM. Etc. At least this is how I parse it.
- OJFord 6y agoYes, this isn't usually an argument I care for, I happily use zero-based and occasionally having to pause to remember to get it right in SQL is a minor annoyance and that's that. But then recently I was doing some 'munging' to get some data structured correctly to display in a chart over months, with a variable start month that depended on the data. Well, let's just say that involved a fair amount of +/- 1 ing, and is hopefully the last time I think 'hm, it'd actually be quite nice if you could choose which to use on access' (or per function?).