Date.prototype.getMinutes
Returns the minutes.
Available since: ES1
Syntax
date.getMinutes()Return value
numberThe minutes from 0 to 59.
Examples
Time in HH:MM format:
const date = new Date(2026, 2, 15, 9, 5);
const hh = String(date.getHours()).padStart(2, '0');
const mm = String(date.getMinutes()).padStart(2, '0');
console.log(`${hh}:${mm}`);Output:
09:05Notes
Minutes below 10 come as one digit, so they are padded with a zero using padStart().
See also
- Date.prototype.getHours — Returns the hour.
- Date.prototype.getSeconds — Returns the seconds.
- String.prototype.padStart — Pads a string on the left to a given length.
In the tutorial
- Dates and time — The Date object in JavaScript: creating a date, reading the year, month and day, changing a date, the difference between dates and the ISO format.