5 ms·
The reason there's an "exception" for days is that the numbers are the widely-used names for the day of the month. Months arguably don't have widely-used numeri
by baddox 7y ago
The reason there's an "exception" for days is that the numbers are the widely-used names for the day of the month. Months arguably don't have widely-used numeric names, although it's pretty reasonably to argue that because numeric month-and-day formatting is so ubiquitous it would have been okay to 1-index the months.
It occurs to me that "9/11" is the one date I can think of where the month is commonly verbally referred to by its number.
- samatman 7y agoThat's... a terrible argument. 1970-01-01T00:00:00 is the start of the Unix Epoch, it is definitely not 1970-00-01T00:00:00. This is consistent across all the warty and various ways to represent the Gregorian calendar, the fifth month is always May, no exceptions.
- strbean 7y agoI think parent means that we often say: > I get my check on the first of the month But never really say > I'm going on vacation for the sixth (month) of the year Seems like they are just trying to explain the bad decision, not justify it.
- baddox 7y agoYes, I'm not trying to justify it. And it's not just that we say "the fifth day of May," because it's also true that we can say "the third month." My point is that the fifth day of May is actually named "5" and there's no other name for dates (other than specially=named days, of course).
- paulddraper 7y agoThat consistent with days of the week, which start at 0 on Sunday. The bigger WTF is getYear(), which returns the year minus 1,900.
- pintxo 7y agoWasn't the reason for the 0-indexed month that this would make picking the name of the month from the 0-indexed array of month names easier?
- gruez 7y ago> Months arguably don't have widely-used numeric names, You forgot about east asian languages, which all use numeral months. https://en.wikipedia.org/wiki/Chinese_calendar#Month https://en.wikipedia.org/wiki/Chinese_calendar#Month https://en.wikipedia.org/wiki/Japanese_calendar#Months https://en.wikipedia.org/wiki/Japanese_calendar#Months https://en.wikipedia.org/wiki/Korean_calendar#Months https://en.wikipedia.org/wiki/Korean_calendar#Months