Home » JavaScript Date getUTCMonth() Method

JavaScript Date getUTCMonth() Method

by Online Tutorials Library

JavaScript Date getUTCMonth() method

The JavaScript date getUTCMonth() method returns the integer value that represents month for the specified date on the basis of universal time. The value returned by getUTCMonth() method starts with 0 that represents January.

Syntax

The getUTCMonth() method is represented by the following syntax:

Return

An integer value between 0 and 11 that represents the month in the specified date.

JavaScript Date getUTCMonth() method example

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

Example 1

Let’s see an example to print current month according to universal time.

Test it Now

Output:

Month value : 8  

Example 2

Let’s see an example to print the month from the given date according to universal time.

Output:

Test it Now

Month value1 : 8  Month value2 : 9  
Next TopicJavaScript Date

You may also like