JavaScript getMinutes() Method
Example
Return the minutes of a time based on local time:
var d = new Date();
var n = d.getMinutes();
n Output result:
Try it »
Definition and Usage
The getMinutes() method returns the minutes field of a time.
Browser support





All major browsers support the getMinutes() method.
Syntax
Date
.getMinutes()
Return Value
| Type | Description |
|---|---|
| Number | The minutes field of the date object, displayed in local time. The return value is an integer between 0 and 59. |
Technical Details
| JavaScript version: | 1.0 |
|---|
More examples
Example
Return the minutes of a set date and time:
var d = new Date("July 21, 1983 01:15:00");
var n = d.getMinutes();
n Output result:
15
Try it »
Display the current time
How to use getHours(), getMinutes(), and getSeconds() to display the current time.
JavaScript Date object