Date.prototype.getMonth()
Returns the month of a date in local time as a zero-based number.
Syntax
date.getMonth()
Returns
number — The month, 0 (January) through 11 (December).
Examples
const d = new Date("2026-01-15");
console.log(d.getMonth());
Output
0
const months = ["Jan", "Feb", "Mar"];
const d = new Date("2026-03-01T12:00:00");
console.log(months[d.getMonth()]);
Output
Mar
Notes
- Months are zero-based, so January is `0` and December is `11`.
- Use `getUTCMonth()` for the UTC month.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |
| node | 0.10 |