JavaScript: Date.getUTCMonth() method. In this tutorial, you will learn how to get UTC month in javascript with an example.
JavaScript: Date.getUTCMonth() Method
Definition:- Javascript date getUTCMonth() method is used to get the month for the specified date according to universal time. The getUTCMonth method will return an integer value between 0 and 11.
Syntax
The syntax is date.getUTCMonth method is:
Date.getUTCMonth()
Note: January is 0, February is 1, and so on.
Example
Now we will take an example of javascript getUTCMonth() method:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript date.getUTCMonth Method</title> </head> <body> <script type = "text/javascript"> var currentDate = new Date(); document.write("the javascript date.getUTCMonth() : " + currentDate.getUTCMonth() ); </script> </body> </html>
Result of the above code is
Conclusion
In this javascript tutorial, you have learned how to get a month using getUTCMonth function with example.
You may like
- JavaScript: Date.getUTCDate() Method
- javaScript Digital Clock with date
- JavaScript: Set Date Methods
- String Contains JavaScript | String includes() Method
- JavaScript Get Date Methods
- JavaScript Operators With Examples
- Sorting Using JavaScript Array Sort() Method
- JavaScript Replace String With Examples
- JavaScript Array splice() Method By Example
- JavaScript: Clone an Array & Object By Example
- Check the Object is Array or not in javascript
- JavaScript: Convert String to Array JavaScript
- javaScript Push() Array By Example
- javaScript Push Array, Items Into Array Example
- JavaScript: Important Array Methods
If you have any questions or thoughts to share, use the comment form below to reach us.