Why getMinutes ?
JavaScript Date The getMinutes () method makes the conversion according to the specified date. On this acre, it rotates the minute (returns 0 to 59 minutes of the specified date and time).
Syntax:
Date.getMinutes()
return: Returns the minutes in the specified date according to local time.
JavaScript getMinutes Examples
Example 1
The JavaScript Date getMinutes () method can return minute of the current time.
var now = new Date('July 21, 1983 01:15:22');
console.log(now.getMinutes());
15
Example 2
The JavaScript Date getMinutes () method returns the minute of the specified time.
var date = new Date('July 21, 1983 22:47:55');
console.log(date.getMinutes());
47
Example 3
Returns 0 if we don’t enter minutes.
var date = new Date('July 21, 1983 ');
console.log(date.getMinutes());
0
Browser Support
| Chrome | yes |
| Edge | yes |
| Firefox | 1 |
| Internet Explorer | yes |
| Opera | yes |
| Safari | yes |
| Android webview | yes |
| Chrome for Android | yes |
| Edge mobile | yes |
| Firefox for Android | 4 |
| Opera Android | yes |
Leave a comment