JavaScript Date getMonth() method18 Mar 2025 | 1 min read The JavaScript date getMonth() method returns the integer value that represents month in the specified date on the basis of local time. The value returned by getMonth() method starts with 0 that represents January. SyntaxThe getMonth() method is represented by the following syntax: ReturnAn integer value between 0 and 11 that represents the month in the specified date. JavaScript Date getMonth() method exampleHere, we will understand getMonth() method through various examples. Example 1Let's see an example to print current month. Output: 7 Example 2Let's see an example to print the month from the given date. Output: 8 Next TopicJavaScript Math |
JavaScript Date method The JavaScript date method is used to set the hour for the specified date on the basis of universal time. Syntax The method is represented by the following syntax: dateObj.setUTCHours(hoursValue[, minValue[, secValue[, msValue]]]) Parameter hoursValue - It represents an integer value between 0 and 23,...
2 min read
JavaScript Date method The JavaScript date method returns the hour for the specified date on the basis of local time. Syntax The method is represented by the following syntax: dateObj. Return An integer value between 0 and 23 that represents the hour. JavaScript Date method example Here, we will...
1 min read
JavaScript Date method The JavaScript date method returns the specified date in the form of string using the UTC time zone . Syntax The method is represented by the following syntax: dateObj. Return A string representing the specified date. JavaScript Date method example Here, we will understand method...
1 min read
JavaScript Date method The JavaScript date method returns the day for the specified date on the basis of local time. Syntax The method is represented by the following syntax: dateObj. Return An integer value between 1 and 31 that represents the day of the specified date. JavaScript Date ...
1 min read
JavaScript Date method The JavaScript date method returns the primitive value of a Date object. Syntax The method is represented by the following syntax: dateObj. Return A primitive value of a Date object. JavaScript Date method example Here, we will understand method through various examples. Example 1 Let's see an...
1 min read
JavaScript Date method The JavaScript date method returns the hour for the specified date on the basis of universal time. Syntax The method is represented by the following syntax: dateObj. Return An integer value between 0 and 23 that represents the hour. JavaScript Date method example Here, we will understand...
1 min read
JavaScript Date method The JavaScript date method is used to set the seconds for a specified date on the basis of universal time. Syntax The method is represented by the following syntax: dateObj.setUTCSeconds( secValue[, msValue]]]) Parameter secValue - It represents an integer value between 0 and 59, specifying...
1 min read
JavaScript Date method The JavaScript date method is used to set the day of the Date object on the basis of universal time. If the given day value is outside the range of the month, the method will adjust the Date object accordingly. Syntax The...
1 min read
JavaScript Date method The JavaScript date method returns a Date object in the form of string. Syntax The method is represented by the following syntax: dateObj. Return A string representing the specified date. JavaScript Date method example Here, we will understand method through various examples. Example 1 Let's see an...
1 min read
JavaScript Date method The JavaScript date method returns the integer value that represents month for the specified date on the basis of universal time. The value returned by method starts with 0 that represents January. Syntax The method is represented by the following syntax: dateObj. Return An...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India