• JavaScript Video Tutorials

JavaScript - Date getUTCMonth() Method



Description

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.

Syntax

Its syntax is as follows −

Date.getUTCMonth()

Return Value

Returns the month in the specified date according to universal time.

Example

Try the following example.

<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>

Output

javascript_date_object.htm
Advertisements