News for hackers. Stuff that matters.
Re:Dates and Times in JavaScript – A New API for Dates from ... by tzs on Thursday July 09, 2020 @05:49PM (#23785634)
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.
Re:Dates and Times in JavaScript – A New API for Dates from ... by mrlala on Friday July 10, 2020 @10:59AM (#23792143)
Well 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.