Description
The getMonth() method returns the month (from 0 to 11) for the specified date, according to local time. January is 0, February is 1, etc.
This method has the form:
Date.getMonth()
Examples
The following example shows the basic use of this method.
<script>
var d = new Date();
document.write(d.getMonth());
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|