4 ms·
I believe that the logic behind 0 based months in many languages that use them, although I don’t know if this is true for JavaScript, is that month numbers are
by tzs 6y ago
I believe that the logic behind 0 based months in many languages that use them, although I don’t know if this is true for JavaScript, is that month numbers are often used as an index into a table of month names so numbering months from 0 is convenient.
- mrlala 6y agoWell sure, I get the reason behind.. but the reality is it's just a horrible convention, especially when you pass multiple inputs (year, month, day, hour, minute, second) and "month" is based on 0 index but the rest are not.