Topic: why does Javascript thinks its May?

$date = new Date();
$curr_month = $date.getMonth();

This gives 5...

My system clock is correct!

What gives?

Re: why does Javascript thinks its May?

Its because the getMonth method returns a number between 0 and 11. Kind of counter intuitive I know smile.

Alex

Re: why does Javascript thinks its May?

I should have worked that one out... zero-based indexs!

Kind of counter intuitive I know

For sure smile

Cheers Alex.