From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Date Object
The getUTCMonth() method returns a number that represents the month according to the Universal Coordinated Time (UTC).
| dateObject.getUTCMonth() |
Note: The value returned by getUTCMonth() is a number between 0 and 11. January is 0, February is 1 and so on.
Note: This method is always used in conjunction with a Date object.
Tip: The Universal Coordinated Time (UTC) is the time set by the World Time Standard.
Example 1Get the current month:
The output of the code above will be: Try it yourself » |
Example 2Get the example above to write the name of the month (not just a number):
The output of the code above will be: Try it yourself » |
JavaScript Date Object
From http://www.w3schools.com (Copyright Refsnes Data)