The javascript Date.getUTCMonth() method returns the month on the specified date according to universal time. The value returned by getUTCMonth is an integer between 0 and 11 corresponding to the month. 0 represents January, 1 represents February, 2 represents March, and so on.
Grammar
Date.getUTCMonth()
Here are the details of the parameters:
Return value:
Returns the month of the specified date according to universal time.
Example:
The following example prints the month part of the current time 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 the following results:
getUTCMonth() : 7