setMonth

fun setMonth(month: Int, date: Int = definedExternally): Int(source)

Sets the month value in the Date object using local time.

Parameters

month

A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.

date

A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.

MDN Reference