getMonth( )
Returns the number of the month for a specified date.
Syntax
<oRef>.getMonth( )
<oRef>
The Date object whose corresponding month number you want to return.
Property of
Date
Description
The getMonth( ) method returns a date’s month number. The number is zero-based:
Month |
Number |
January |
0 |
February |
1 |
March |
2 |
April |
3 |
May |
4 |
June |
5 |
July |
6 |
August |
7 |
September |
8 |
October |
9 |
November |
10 |
December |
11 |
Note
The equivalent date function, MONTH( ), is one-based, not zero-based.