Copyright © tutorialspoint.com
Javascript date getUTCMonth() method returns the month in the specified date according to universal time. The value returned by getUTCMonth is an integer between 0 and 11 corresponding to the month. 0 for January, 1 for February, 2 for March, and so on.
Date.getUTCMonth() |
Here is the detail of parameters:
NA
Returns the month in the specified date according to universal time.
The following example prints the month portion of the current time to the variable hrs.
<html>
<head>
<title>JavaScript getUTCMonth Method</title>
</head>
<body>
<script type="text/javascript">
var dt = new Date();
document.write("getUTCMonth() : " + dt.getUTCMonth() );
</script>
</body>
</html>
|
This will produce following result:
getUTCMonth() : 7 |
To understand it in better way you can Try it yourself.
Copyright © tutorialspoint.com