setMinutes() writes the minute (0–59) on a Date in local time, with optional seconds and milliseconds. This guide covers syntax, scheduling patterns, overflow, and comparisons with UTC setters.
01
Syntax
setMinutes(m)
02
0–59
Minutes
03
Overload
m, s, ms
04
Mutates
In place
05
+ minutes
getMinutes + n
06
Returns
Epoch ms
Fundamentals
Introduction
“Start in 15 minutes,” “round to the top of the hour,” and time-picker forms all need to change the minute hand on a Date. After reading minutes with getMinutes(), setMinutes() writes them back in local time.
Like other setters, it mutates the original object and returns epoch milliseconds—not the Date for chaining.
Concept
Understanding the setMinutes() Method
Date.prototype.setMinutes(minute [, second [, millisecond]]) accepts a local minute and up to two optional sub-minute fields. When you pass only the minute, the hour stays the same unless overflow normalization rolls into the next hour.
Values outside normal ranges roll forward or backward— setMinutes(75) on 12:30 becomes 13:15. For UTC minute writes, use setUTCMinutes().
💡
Beginner Tip
To snap to the top of the hour: date.setMinutes(0, 0, 0). To add fifteen minutes: date.setMinutes(date.getMinutes() + 15).
75 minutes = 1 hour + 15 minutes. The engine normalizes instead of clamping to 0–59.
Applications
🚀 Common Use Cases
Meeting delays — push start time with getMinutes() + N.
Hourly buckets — setMinutes(0, 0, 0) for report windows.
Time pickers — apply user-selected minutes to a Date.
Cron-style snaps — align to :00 or :30 marks.
Test fixtures — pin exact minute/second/ms in unit tests.
Clone + mutate — copy a Date before changing minutes for comparisons.
🧠 How setMinutes() Updates the Clock
1
Read local time
Engine loads current local hour, minute, and sub-minute fields.
Local
2
Apply new minute
Minute and optional second/ms replace old sub-hour values.
setMinutes
3
Normalize overflow
Out-of-range values roll into adjacent hours or days.
Normalize
4
⏱
Mutate & return ms
Date updates in place; epoch milliseconds are returned.
Important
📝 Notes
setMinutes() uses local time minutes 0–59 (overflow normalizes).
Mutates the original Date—clone with new Date(date) when needed.
Returns epoch ms, not the Date—no fluent chaining on the return value.
Optional second and millisecond args default to 0 when omitted after minute.
For adding duration across hours, getMinutes() + N is simpler than manual hour math.
Use setUTCMinutes when rules follow UTC, not local wall clock.
Compatibility
Browser & Runtime Support
Date.prototype.setMinutes() has been available since ES1. It works in every browser and Node.js.
✓ Baseline · ES1
Date.prototype.setMinutes()
Supported in Chrome, Firefox, Safari, Edge, Internet Explorer, and all Node.js versions. No polyfill required.
99%Universal API
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
Date.setMinutes()Excellent
Bottom line: Safe everywhere. Remember mutation, overflow, and the three-argument snap pattern.
Wrap Up
Conclusion
setMinutes() writes the local minute (and optionally seconds and milliseconds) on a JavaScript Date. Use it for scheduling shifts and hour snaps; clone first when preserving the original instant.
Next, learn setMonth() to change the calendar month, or review getMinutes() for reading the minute.
Use setMinutes(0, 0, 0) to snap to the top of the hour
Use getMinutes() + N for relative minute shifts
Clone before mutating shared Date instances
Pair with getMinutes() to verify results
Use setUTCMinutes for UTC scheduling rules
❌ Don’t
Assume setters return the Date for chaining
Wrap the return value in new Date(...) expecting a copy
Assume values clamp at 59 (overflow rolls hours)
Mix local setters with UTC getters in one label
Forget that omitted second/ms args become 0 in overload calls
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about Date.setMinutes()
Your foundation for local minute writes in JavaScript.
5
Core concepts
📝01
Syntax
setMinutes(m)
API
🔢02
0–59
Minutes.
Range
📈03
3 args
m, s, ms.
Overload
➕04
+ minutes
getMinutes + n.
Pattern
🔄05
Mutates
In place.
Behavior
❓ Frequently Asked Questions
It sets the minutes (0–59) of a Date object in local time. Optional arguments can also set seconds and milliseconds. The Date mutates in place and returns updated epoch milliseconds.
getMinutes() reads the current local minute. setMinutes(m) writes a new minute. They are the read/write pair for the minute hand of the local clock.
Yes. setMinutes(minute, second, millisecond) updates all three sub-hour fields at once—useful for snapping to :00:00.000 at the top of an hour.
JavaScript normalizes overflow into the next hour. setMinutes(75) on 12:30 becomes 13:15 (75 minutes = 1 hour + 15 minutes).
No. It returns a number (epoch milliseconds). Call each setter on the same Date variable—do not chain on the return value.
setMinutes() changes the local clock minute. setUTCMinutes() changes the UTC clock minute. Use the one that matches your timezone rules.
Did you know?
setMinutes(0, 0, 0) keeps the current hour but clears minutes, seconds, and milliseconds—unlike the old tutorial myth, setters do mutate the original Date; they do not return a new copy.