ES6 - getMonth() Method



Javascript date getMonth() method returns the month in the specified date according to local time. The value returned by getMonth is an integer between 0 and 11. 0 corresponds to January, 1 to February, and so on.

Syntax

Date.getMonth ()   

Return Value

Returns the Month in the specified date according to local time.

Example

var dt = new Date("December 25, 1995 23:15:00");  
console.log("getMinutes() : " + dt.getMinutes());  

Output

getMonth() : 11 
Advertisements