Javatpoint Logo
Javatpoint Logo

JavaScript Date setUTCMonth() method

The JavaScript date setUTCMonth() method is used to set the integer value that represents the month in the specified date on the basis of universal time. The setUTCMonth() method value starts with 0 that represents January.


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.

JavaScript Date setUTCMonth() method example

Here, we will understand setUTCMonth() method through various examples.

Example 1

Let's see an example to print current and updated month.

Test it Now


Current month : 8
Updated month : 9 

Example 2

Let's see an example to update the month of the given date.

Test it Now



Example 3

In this example, we will also specify the particular day with the month.

Test it Now


Updated month : 12
Next TopicJavaScript Date

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA