Date.getMonth()
Returns the month (from 0-11)
Last updated
Returns the month (from 0-11)
Last updated
The getMonth() method returns the month in the specified date according to local time, as a zero-based value (where zero indicates the first month of the year).
Return value
An integer number, between 0 and 11, representing the month in the given date according to local time. 0 corresponds to January, 1 to February, and so on.
getMonth()
The second statement below assigns the value 11 to the variable month
, based on the value of the object Xmas95
.
Uros Durdevic