For some reason, Node.js thinks it’s February 4. Am I missing something?
> new Date().getMonth()
2
> new Date().getDay()
4
>
For some reason, Node.js thinks it’s February 4. Am I missing something?
> new Date().getMonth()
2
> new Date().getDay()
4
>
Does JS start counting at 0? If so, then it knows it’s March. As for the 4… it’s neither March 4th nor March 5th.
4
= Thursday (0
= Sunday), 2
= March. Always read the MDN!
Thanks for helping, I’ll normalize it later
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.