Introduction to the use of the getUTCMonth () method in JavaScript
The javascript Date. getUTCMonth () method returns the month of the specified Date based on the common time. The value returned by getUTCMonth is the month corresponding to an integer between 0 and 11. 0 represents January, 1 represents February, 2 represents March, and so on.
Syntax
The following is the detailed information about the parameters:
Return Value:
Returns the month of the specified date based on the common time.
Example:
The following example prints the month of the current time variable hrs.
| 1 2 3 4 5 6 7 8 9 10 11 |
<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 produces the following results: