JavaScript Date.getMinutes()

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

Chromeyes
Edgeyes
Firefox1
Internet Exploreryes
Operayes
Safariyes
Android webviewyes
Chrome for Androidyes
Edge mobileyes
Firefox for Android4
Opera Androidyes

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑

Design a site like this with WordPress.com
Get started