The setUTCMonth() method is represented by the following syntax:
monthValue - It represents an integer value between 0 and 11 specifying the month.
dayValue - It is optional. It represents an integer value between 1 and 31 specifying the day of the month.
Here, we will understand setUTCMonth() method through various examples.
Let's see an example to print current and updated month.Test it Now
Current month : 8 Updated month : 9
Let's see an example to update the month of the given date.Test it Now
In this example, we will also specify the particular day with the month.Test it Now
Updated month : 12