Date getUTCMonth() Method - Javascript Date

Javascript examples for Date:getUTCMonth


The getUTCMonth() method returns the month (from 0 to 11), according to universal time.

January is 0, February is 1, and so on.

UTC time is the same as GMT time.



Return Value:

A Number, from 0-11, representing the month

The following code shows how to return the month, according to universal time:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {/*w ww.j av  a2 s  . com*/
    var d = new Date();
    var n = d.getUTCMonth();
    document.getElementById("demo").innerHTML = n;


Related Tutorials