By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,963 Members | 1,994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,963 IT Pros & Developers. It's quick & easy.

javascript default date is one month off

P: n/a
I just noticed that all my javascript months are off by one
month.....didn't test multiple systems tho and my system date is fine.

Any way of fixing this?

TIA,
Ahmed

Dec 6 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ah*****@gmail.com writes:
I just noticed that all my javascript months are off by one
month.....didn't test multiple systems tho and my system date is fine.

Any way of fixing this?


Most likely by realising that the results returned by Date's getMonth
is zero-based, i.e., 0 for January and 11 for December. Knowing that
instantly makes the results correct :)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Dec 6 '05 #2

P: n/a
lol, i guess that answers my question! :)

Dec 6 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.