4 ms·
Days are natural numbers. Months are a string array. It seems intuitive to me. If you looked at a calendar and typed the data, that’s what you’d end up with.
by kube-system 6y ago
Days are natural numbers.
Months are a string array.
It seems intuitive to me. If you looked at a calendar and typed the data, that’s what you’d end up with.
- deepsun 6y agoMonth is not always string array, for example in ISO: 2020-11-23. And days can be string as well: "1st November".
- kube-system 6y agoIt was a string array first. ISO came long after the Gregorian calendar. And the months came from the Julian calendar. If we go all the way back, one could say it was a mixed array of string and integer. September (7), October (8), November (9), and December (10) are linguistically ordinal names... but they’re all off by two since the deprecation of the Roman calendar.
- 082349872349872 6y agoSince Julius and Augustus. (written 4 Freezy 229)
- _Microft 6y agoIt was a list of names long before it was considered "a string array".
- jsrjenkins 6y agoActually the Romans counted their months beginning with March: March (1) April (2) May (3) ... July (5) (named after Julius Caesar) August (6) (named after Augustus) September (7) ... etc. The reason being in the ancient world all serious activity begins in the spring, especially war campaigns which were to be under the aegis of the god Mars, from which the name of the month. Note that when we have a leap year we add the extra day to the end of the Roman year, that is at the end of February which is the last month of the year. More precisely, we duplicate the sixth of the calends of March. This is why in French the leap year is called 'bisextile'.
- coding123 6y agoThis is the correct answer. Months often need to be translated to a name. A day of month is not translated to a name.
- mhd 6y agoWell, if everything were based on how it appears in a calender, you'd think that Americans would start their friggin dates with the month, too ;) In German I'd say that both two number dates (lit. "schedule a meeting for the ninth eighth") as well as month names (lit. "my birthday is on the eighteenth May") is common, so we might be more accustomed to thinking of months as numbers. If Roman emperors would've done a better job, we all would. I think Windows does months as 1-indexed, but then makes a mess of days of the week.
- samatman 6y ago> you'd think that Americans would start their friggin dates with the month, too We... do? America writes dates such as March 14th 2020 as 3/14/20. ISO 8601 is of course superior but I like the month-first approach, because "the 14th day of" doesn't tell you anything until you know "March", it seems more natural.
- jhoechtl 6y agoSorting becomes so much easier though wenn its yyyy-mm-dd
- mhd 6y agoToo early today for me to write posts ;) "Year" first would be more the point where it gets confusing, as when you really start reading the details from a calendar, the year would be first, too. (When you're actually talking, of course, the year is rarely mentioned.) I'm just saying that going from how you say something in your native language to internal data representation is quite error-prone.
- philwelch 6y agoI actually find the European custom more logical. If we are having a casual conversation and I’m referring to a previous event that happened on the 14th, you can assume from context that I mean the 14th of the current or previous month (eg the 14th of November as of the writing of this comment). If it isn’t the current month (+-1 based on context), I can instead specify that I meant the 14th of September and you will understand that I mean the 14th of September this current year (again +-1 by context). If I meant the 14th of September, 1987, I will say the whole date. But since most date-based conversations have an implied context, being able to simply truncate dates for brevity is useful. ISO 8601 is big-endian, European style is little-endian, and US-style is just kind of pointless.