Favorites

JavaScript Date.prototype.getMonth() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Date.prototype.getMonth()
JavaScript Date Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The getMonth() method returns the month of a date as a number from 0 (January) to 11 (December).

Description

The getMonth() method returns the month, counted from zero: January is 0 and December is 11. Add 1 when displaying it as a number. To get the month name, use toLocaleDateString() with { month: 'long' }.

The zero-based month numbering is a common source of off-by-one bugs, especially when building dates with new Date(year, month, day), where the month is zero-based too. ISO strings and most other systems number months from 1.

Like the other get...() methods without "UTC" in their name, it uses the time zone of the user's device, so the same moment can give different results for users in different places. Each has a getUTC...() counterpart for UTC, and for showing a date in a particular time zone, toLocaleString() with the timeZone option is the easiest approach.

Syntax

date.getMonth()

Return Value

The month in local time, from 0 (January) to 11 (December).

Example

const d = new Date(2026, 10, 28);
console.log(d.getMonth());
console.log(d.getMonth() + 1);
console.log(d.toLocaleDateString('en', { month: 'long' }));

Browser Support

The following information will show you the current browser support for the Date.prototype.getMonth() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee