JavaScript Date getMinutes() Method

Beginner
⏱️ 8 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Minutes (0–59)

What You’ll Learn

getMinutes() returns the minute component as an integer from 0 to 59 in local time. This guide covers syntax, five examples, UTC comparisons, validation, clock formatting, and reminder patterns.

01

Syntax

date.getMinutes()

02

Range

0 – 59

03

Local time

Not UTC

04

With hours

Build HH:MM

05

Reminders

Match :30

06

Validate

Invalid → NaN

Introduction

Clocks, countdowns, and “meeting starts at :30” labels need the minute part of a Date. The getMinutes() method returns that value as an integer using the user’s local timezone.

Pair it with getHours() to build HH:MM displays, or use toLocaleTimeString() when locale formatting is enough.

Understanding the getMinutes() Method

Date.prototype.getMinutes() is a zero-argument instance method. It never mutates the original Date—it only reads the minute component within the current hour in local time.

On a time like 14:30:45, getHours() returns 14 and getMinutes() returns 30. Seconds and milliseconds come from their own getters.

💡
Beginner Tip

For display, pad single-digit minutes: String(m).padStart(2, "0") turns 5 into "05" so 9:05 does not show as 9:5.

📝 Syntax

JavaScript
dateObj.getMinutes()

Parameters

  • None.

Return value

  • Integer 0–59 for a valid date in local time.
  • NaN if dateObj is an invalid Date.

⚡ Quick Reference

GoalCode
Current minutesnew Date().getMinutes()
Minutes from fixed timenew Date(2026, 6, 4, 14, 30).getMinutes() → 30
UTC minutesdate.getUTCMinutes()
Pad for clockString(m).padStart(2, "0")
Set minutesdate.setMinutes(45)
Valid date check!Number.isNaN(date.getTime())

📋 getMinutes() vs Similar Methods

Time getters split one instant into parts. Use the getter that matches the field you need.

getMinutes()
0–59

Local minutes

getUTCMinutes()
UTC min

Timezone-safe read

getHours()
0–23

Hour part

getSeconds()
0–59

Second part

Examples Gallery

Open DevTools Console (F12) or use Try-it links. Fixed times use new Date(y, m, d, h, min) for predictable local values.

📚 Getting Started

Read the minute component from the current time.

Example 1 — Get the Current Minutes

Call getMinutes() on a new Date() to read the minute right now.

JavaScript
const now = new Date();
const minutes = now.getMinutes();

console.log("Current minutes:", minutes);
Try It Yourself

How It Works

The value updates each minute and stays between 0 and 59. Hours and seconds are separate getters.

📈 Practical Patterns

Fixed times, validation, display, and reminders.

Example 2 — Read Minutes from a Specific Time

Build a date at 2:30 PM local time and read hour and minute together.

JavaScript
const eventTime = new Date(2026, 6, 4, 14, 30);

console.log(eventTime.getHours());    // 14
console.log(eventTime.getMinutes());  // 30
Try It Yourself

How It Works

The five-argument constructor sets local year through minutes. Prefer this over ISO strings in tutorials to avoid timezone parsing surprises.

Example 3 — Validate Before Calling getMinutes()

Guard against invalid Date objects that yield NaN.

JavaScript
function safeGetMinutes(date) {
  if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
    return null;
  }
  return date.getMinutes();
}

console.log(safeGetMinutes(new Date()));              // e.g. 18
console.log(safeGetMinutes(new Date("not-a-date")));  // null
Try It Yourself

How It Works

getTime() returns NaN on invalid dates. Checking first keeps clock UI from showing broken values.

Example 4 — Build an HH:MM Clock String

Combine getHours() and padded getMinutes() for a simple digital clock.

JavaScript
function formatHourMinute(date) {
  const hours = date.getHours();
  const minutes = String(date.getMinutes()).padStart(2, "0");
  return hours + ":" + minutes;
}

console.log(formatHourMinute(new Date(2026, 6, 4, 9, 5)));
// "9:05"
Try It Yourself

How It Works

padStart(2, "0") ensures two-digit minutes. For production apps, toLocaleTimeString() handles locale and AM/PM rules automatically.

Example 5 — Half-Hour Reminder Check

Run logic when the current minute is 0 or 30.

JavaScript
function checkHalfHourReminder() {
  const minute = new Date().getMinutes();

  if (minute === 0 || minute === 30) {
    return "Half-hour reminder!";
  }
  return "No reminder right now.";
}

console.log(checkHalfHourReminder());
Try It Yourself

How It Works

Minute-only checks ignore seconds. For exact timestamps, also compare hours or use getTime() against a target instant.

🚀 Common Use Cases

  • Digital clocks — show HH:MM with padded minutes.
  • Meeting times — “starts at :30” labels from event dates.
  • Cron-like UI — trigger when getMinutes() === 0.
  • Pomodoro apps — track 25-minute blocks via minute math.
  • Analytics — bucket activity by minute of hour.
  • Form defaults — pre-fill minute dropdowns on time pickers.

🧠 How getMinutes() Resolves the Value

1

Internal instant

The Date stores milliseconds since Unix epoch (UTC).

Storage
2

Local conversion

Engine applies the runtime timezone offset.

TZ
3

Extract minutes

Minute 0–59 within the current hour is returned.

getMinutes
4

Use in UI

Format, compare, schedule, or pass to setMinutes.

📝 Notes

  • getMinutes() is local; use getUTCMinutes() when you standardize on UTC.
  • Range is 0–59 only for valid dates.
  • Invalid dates propagate NaN—validate first.
  • Pad minutes when building fixed-width clock strings.
  • Minute-only rules ignore seconds—combine getters for precision.
  • For display, prefer toLocaleTimeString() or Intl.DateTimeFormat.

Browser & Runtime Support

Date.prototype.getMinutes() has been available since the first JavaScript Date implementation (ES1). It works in every browser and Node.js.

Baseline · ES1

Date.prototype.getMinutes()

Supported in Chrome, Firefox, Safari, Edge, Internet Explorer, and all Node.js versions. No polyfill required.

99% Universal API
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. Watch timezone boundaries when pairing with UTC getters or server timestamps.

Conclusion

getMinutes() is the standard way to read the minute component (0–59) from a JavaScript Date in local time. Pair it with getHours() for clocks, validate invalid dates, and use setMinutes when you need to write the value.

Next, learn getMonth() for the zero-based month index, or getSeconds() for the second component.

💡 Best Practices

✅ Do

  • Validate dates before calling getMinutes()
  • Pad minutes with padStart(2, "0") for clocks
  • Combine with getHours() for time displays
  • Pick UTC getters when storing UTC instants
  • Use locale formatters for user-facing time strings

❌ Don’t

  • Confuse getMinutes() with getMilliseconds()
  • Parse ISO strings blindly when teaching fixed local times
  • Ignore NaN from bad parses
  • Schedule to the second using minute checks alone
  • Assume minutes display well without padding

Key Takeaways

Knowledge Unlocked

Five things to remember about Date.getMinutes()

Your foundation for minute reads in JavaScript.

5
Core concepts
🔢 02

0–59

Per hour.

Range
🌐 03

Local

Not UTC.

Timezone
🕐 04

HH:MM

With getHours.

Pattern
05

Pad 2

padStart.

Display

❓ Frequently Asked Questions

An integer from 0 to 59 representing the minutes within the current hour of the Date object's local timezone.
getMinutes() uses local timezone rules. getUTCMinutes() reads the UTC minute component. They can differ near hour boundaries across timezones.
getMinutes() returns 0–59 for the minute hand of the clock. getMilliseconds() returns 0–999 for the fraction inside the current second.
NaN. Validate with !Number.isNaN(date.getTime()) before using the result in UI or conditionals.
No for valid dates—the range is 0–59. When minutes overflow via setMinutes, JavaScript normalizes into the next hour.
String(date.getMinutes()).padStart(2, '0') turns 5 into '05' for clock displays like 9:05.
Did you know?

setMinutes(getMinutes() + 15) adds fifteen minutes and rolls into the next hour automatically—the same overflow idea as setDate(getDate() + n) for days.

Continue to getMonth()

Learn how to read the zero-based month index (0 = January) from a Date object.

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.

6 people found this page helpful