1 person found this helpful
Months are numbered from 0 thru 11, so November is month 10.
The same kind of relationship goes for the getDay() method, where 0 is Sunday, 1 is Monday, etc...
As far as my memory serves me, this is common across programming languages.
So, what's the cure?
Should I add 1 to the month variable? How? ++ I suppose...
Don't know the correct syntax...
Thank you anyway for replying!
If you want to display the month numbers as they are commonly seen (1 thru 12) then yes, just add 1 to the value that getMonth() produces...
Thank you very much, Ned!
I already marked your answer as "Correct"...