From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Date Object
The getMinutes() method returns the minutes of a time.
| dateObject.getMinutes() |
Note: The value returned by getMinutes() is a two digit number. However, the return value is not always two digits, if the value is less than 10 it only returns one digit.
Note: This method is always used in conjunction with a Date object.
Example 1Get the minutes of the current time:
The output of the code above will be: Try it yourself » |
Example 2Get the minutes from a specific date and time:
The output of the code above will be:
Try it yourself » |
More Examples |
Display the current time
How to use getHours(), getMinutes(), and getSeconds() to display the current time.
JavaScript Date Object
From http://www.w3schools.com (Copyright Refsnes Data)