- Oct 9, 2002
- 28,298
- 1,235
- 136
Code:
var tempdate=new Date();
tempdate.setMonth(0);
alert("Month: "+tempdate.getMonth());
Code:
var tempdate=new Date();
tempdate.setMonth(1);
alert("Month: "+tempdate.getMonth());
Code:
var tempdate=new Date();
tempdate.setMonth(2);
alert("Month: "+tempdate.getMonth());
Code:
var tempdate=new Date();
tempdate.setMonth(3);
alert("Month: "+tempdate.getMonth());
}
I'm stumped.
0-January
1-February
2-March
3-April
4-May
5-June
6-July
7-August
8-September
9-October
10-November
11-December
Whenever I set the value to 1 (February), it always reads back a value of 2 (March). This is driving me insane!