Thursday, April 26, 2007

May 0th

I just got this random thought.
5:00pm means 5 o'clock. The first minute in a given hour is 00 and the last is 59, that's called zero based indexing in CS world.
But the first day of a given month is, well, the 1st. So beginning of May is 05/01 not 05/00.

Why are we using zero based indexing for minutes, seconds, and hours (in the 24hr format) while using one based indexing for days and months?

4 comments:

Anonymous said...

Because you can't have zero day or zero month you genius !!

Christian said...

Could you be confusing cause and effect here?
Why can't we have zero day and zero month, we have 00:00:00 o'clock don't we? :)

Rain said...

Quite intriguing. And a very valid question, too. Although it makes one wonder what on earth caused you to think about that?!

Anonymous said...

Hmmmmmm, i think it is not about indexing..all of these are 0 based indexing..but it is the meaning of the term we are using..

for example when u say it is 5:00 O'clock, it means it has been 5 hours since some point of time (the numbers here describes the elapsed time)

but when we say it is first of May, it means that we are "currently" at the first day of May, not "elapsed"

the elapsed time can be Zero but what we are currently spending can't be zero...

what do u think?