returns current month code of current Date or month code of specified date.
var date = new Date ("August 21, 2006 01:15:00")
<input type ="button" value ="Click to get month" onclick ="return f();" >
As get month returns an integer between 0 and 11, it will return 7 for August month
In order to get correct results we increment it by 1 .We get output as 8.