Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
jonjo9428yIt is the number of months since January, in the range 0 to 11. Fits into an array of months nicely :D
-
jonjo9428y@OS55 I don't think he sees it as a problem just he is being anal about giving the numbers a different meaning.
-
Voxera113888yThe dumb thing with dates is that month starts at 0 but days start at 1 and you never have to +1 on years
So month are really the odd one out
But really, that one of the lesser evils of dates ;) -
I immediately ran to my computer to fix this in the javascript app I was working on. I didn't even think js would work this way
-
dayo30458y@ocab19 glad I could help, is just so weird how the Date function is so inconsistent with some starting at 1 and others at 0. I could at least live with it if it all made sense
var date = new Date();
var month = date.getMonth();
console.log(month); // 2
who thought it would be a good idea to start the months of at 0 rather then 1
undefined