JavaScript Date getMinutes() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Date

Definition

Date.prototype.getMinutes() returns the minutes for this date as an integer 0–59 in local time (MDN). It is read-only and does not change the Date.

Remember
date.getMinutes()

→ integer 0 … 59
→ NaN if the Date is invalid

Example (MDN-style):
  new Date(2008, 2, 13, 4, 20).getMinutes() → 20

getMinutes()    → local minutes
getUTCMinutes() → UTC minutes

Syntax

Call date.getMinutes. Start with this line.

JavaScript
date.getMinutes()
CallWhat it does
date.getMinutes()Primary signature.
date.getMinutes(...)Call with the arguments your case needs.

Built into JavaScript. Call getMinutes(...) on a Date instance — no import required.

Library declarations
JavaScript
date.getMinutes()

Parameters

This method has no parameters beyond those shown in the signature.

Return Value

Return ValueDescription
*The value returned by date.getMinutes().

JavaScript Examples

Example 1 — Read the Local Minutes

Call getMinutes() on fixed local date-times (MDN-style values).

JavaScript
const morning = new Date(2008, 2, 13, 4, 20); // Mar 13, 2008 04:20
const night = new Date(1995, 11, 25, 23, 15, 30);

console.log(morning.getMinutes()); // 20
console.log(night.getMinutes());   // 15
Try It Yourself

How It Works

  1. Build local times. Month indexes are zero-based (2 = March, 11 = December).
  2. Morning. 04:20 → getMinutes() returns 20.
  3. Evening. 23:15 → 15.
  4. No mutation. The Date values are unchanged.

Example 2 — getMinutes() vs getUTCMinutes()

Local and UTC minutes can disagree near hour boundaries.

JavaScript
const d = new Date("1995-12-25T23:15:30Z"); // 23:15 UTC

console.log(d.getUTCMinutes()); // 15
console.log(d.getMinutes());    // local minutes (often 15, sometimes not)
Try It Yourself

How It Works

  1. UTC instant. The Z suffix means 23:15 in UTC.
  2. UTC getter. getUTCMinutes() always reports 15 for that instant.
  3. Local getter. getMinutes() applies your timezone — usually 15, but can differ near hour edges.
  4. Rule. Need wall-clock local minutes → getMinutes(); need UTC → getUTCMinutes().

Example 3 — Leading Zero for Clocks

Pad single-digit minutes so clocks show 9:05, not 9:5.

JavaScript
function clock(date) {
  const h = String(date.getHours()).padStart(2, "0");
  const m = String(date.getMinutes()).padStart(2, "0");
  return h + ":" + m;
}

console.log(clock(new Date(2026, 0, 1, 9, 5)));  // "09:05"
console.log(clock(new Date(2026, 0, 1, 14, 0))); // "14:00"
Try It Yourself

How It Works

  1. Read fields. getHours() and getMinutes() give the local clock parts.
  2. Pad. padStart(2, "0") turns 5 into "05".
  3. Join. Combine with ":" for a simple HH:MM string.
  4. UI option. For locale-aware clocks, prefer toLocaleTimeString().

Browser & Runtime Support

Date.prototype.getMinutes() is part of the language from early ECMAScript and is Baseline Widely available (MDN).

✓ Baseline · Widely available

Date.prototype.getMinutes()

Supported in every modern browser and Node.js. No polyfill needed for ordinary web apps.

99% Modern browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
Date.getMinutes() Excellent

Bottom line: Safe everywhere. Focus on timezone choice (local vs UTC) and invalid-Date checks rather than feature detection.

Frequently Asked Questions

An integer from 0 to 59 representing the minutes within the current hour in local time. Invalid Dates return NaN.
getMinutes() uses local timezone rules. getUTCMinutes() reads the UTC minute component. They can differ near hour boundaries across timezones.
No for valid dates — the range is 0–59. When minutes overflow via setMinutes, JavaScript normalizes into the next hour.
NaN. Validate with Number.isNaN(date.getTime()) before using the result in UI or conditionals.
String(date.getMinutes()).padStart(2, "0") turns 5 into "05" for clocks like 9:05.
It is Baseline Widely available (from early ECMAScript) and supported in every modern browser and Node.js.

Next: getMonth()

Learn how to read the local month field (0–11) from a Date.

getMonth() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful