Hi, I don't understand why the month
portion of the code below produces a
month of 2 instead of 3. Can anyone
help me understand why this is happening?
Thank you for your help
kp
<script language="javascript">
var now = new Date();
var day = now.getDate();
var month = now.getMonth();
var year = now.getFullYear();
alert('now = ' + now);
alert('day = ' + day);
alert('month = ' + month);
alert('year = ' + year);
</script>
Produces:
day = 10
month = 2 why is this 2 instead of 3 ?
year = 2002
portion of the code below produces a
month of 2 instead of 3. Can anyone
help me understand why this is happening?
Thank you for your help
kp
<script language="javascript">
var now = new Date();
var day = now.getDate();
var month = now.getMonth();
var year = now.getFullYear();
alert('now = ' + now);
alert('day = ' + day);
alert('month = ' + month);
alert('year = ' + year);
</script>
Produces:
day = 10
month = 2 why is this 2 instead of 3 ?
year = 2002