Date.prototype.getMonth() returns the month for this date as a zero-based integer 0–11 in local time (MDN). 0 is January; 11 is December. It is read-only and does not change the Date.
Remember
date.getMonth()
0 = January
1 = February
…
11 = December
→ integer 0 … 11
→ NaN if the Date is invalid
getMonth() → local month index
getUTCMonth() → UTC month index
Syntax
Call date.getMonth. Start with this line.
JavaScript
date.getMonth()
Call
What it does
date.getMonth()
Primary signature.
date.getMonth(...)
Call with the arguments your case needs.
Built into JavaScript. Call getMonth(...) on a Date instance — no import required.
Library declarations
JavaScript
date.getMonth()
Parameters
This method has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
The value returned by date.getMonth().
JavaScript Examples
Example 1 — Read the Local Month Index
Call getMonth() on fixed local dates (MDN-style July and December).
JavaScript
const july = new Date(1969, 6, 20); // July 20, 1969
const december = new Date(1995, 11, 25); // Dec 25, 1995
console.log(july.getMonth()); // 6
console.log(december.getMonth()); // 11
Build February 14. Constructor month 1 is February.
Read the index.getMonth() returns 1.
Lookup.monthNames[1] is "February".
i18n tip. For other languages, prefer Intl.DateTimeFormat over a hard-coded English array (MDN).
Example 3 — getMonth() vs getUTCMonth()
Local and UTC month indexes can disagree near month boundaries.
JavaScript
const d = new Date("1995-12-25T23:15:30Z"); // Dec 25, 1995 UTC
console.log(d.getUTCMonth()); // 11
console.log(d.getMonth()); // local month (often 11, sometimes not)