getMonth() method returns the month as a zero-based index. Hence it is 0 for 12 as a month.
getMonth()