Hacker News new | ask | show | jobs
by danrisso3 3777 days ago
Not to say that one is in February, the other in January.
1 comments

They're both in February. Months represented by integers start at 0.

    > new Date(2016,1,11)
    Thu Feb 11 2016 00:00:00 GMT-0800 (PST)
    > new Date('2016-02-11')
    Wed Feb 10 2016 16:00:00 GMT-0800 (PST)
I make the same mistake constantly even though I learned this years ago.