Date.getMonth

getMonth – Get the month, according to local time (0–11).

Description

Date.getMonth()

Get the month, 0 (January) to 11 (December).

Return values

Integer

Examples

Example #1 – getMonth example
var date = new Date(2015, 9, 21, 16, 29, 00); console.log(date.getMonth()); // 9 console.log(new Date().getMonth()); // Gets the current month.

External references