getUTCMonth() returns the zero-based month index (0–11) from a Date object in UTC. This guide covers syntax, the January = 0 rule, five examples, and comparisons with local getters.
01
Syntax
date.getUTCMonth()
02
Range
0 – 11
03
Jan = 0
Zero-based
04
vs getMonth
Can differ
05
+ 1
Human 1–12
06
Validate
Invalid → NaN
Fundamentals
Introduction
Global reporting often buckets data by UTC calendar months. The JavaScript Date object stores one instant internally; getUTCMonth() reads the month index according to UTC—not the user’s local timezone.
If you need the month for a user-facing local calendar, use getMonth(). Use getUTCMonth() when your logic follows UTC month boundaries.
Concept
Understanding the getUTCMonth() Method
Date.prototype.getUTCMonth() is a zero-argument instance method. It never mutates the original Date—it only reads the UTC month index as an integer from 0 (January) to 11 (December).
The zero-based index matches Date.UTC(year, monthIndex, day) and local getMonth(). March is always index 2, never 3.
💡
Beginner Tip
To show month numbers people expect (1–12), use getUTCMonth() + 1. To show names, map the index to an array or use Intl with timeZone: "UTC".
Foundation
📝 Syntax
JavaScript
dateObj.getUTCMonth()
Parameters
None.
Return value
Integer 0–11 for a valid date in UTC (0 = January).
NaN if dateObj is an invalid Date.
Month index table
0 — January
1 — February
2 — March
…
11 — December
Cheat Sheet
⚡ Quick Reference
Goal
Code
Current UTC month index
new Date().getUTCMonth()
Month from UTC parts
new Date(Date.UTC(2026, 2, 15)).getUTCMonth() → 2
Human month 1–12
date.getUTCMonth() + 1
Local month index
date.getMonth()
UTC year
date.getUTCFullYear()
Valid date check
!Number.isNaN(date.getTime())
Compare
📋 getUTCMonth() vs Similar Methods
UTC getters mirror local getters. Pick the one that matches where your data is displayed or stored.
getUTCMonth()
0–11
UTC month index
getMonth()
local
Local month index
getUTCDate()
1–31
UTC day of month
getUTCFullYear()
2026
UTC year
Hands-On
Examples Gallery
Open DevTools Console (F12) or use Try-it links. Fixed UTC dates use Date.UTC so month indexes stay predictable.
📚 Getting Started
Read the zero-based UTC month index from a known date.
Example 1 — Get the UTC Month Index from a Fixed Date
MONTHS[NaN] returns undefined silently. Validate first so UTC filters and labels never show blank month names.
Example 5 — Compare getMonth() and getUTCMonth()
Near UTC midnight on month boundaries, local and UTC month indexes can differ.
JavaScript
// Jan 31, 2026 at 23:30 UTC
const date = new Date("2026-01-31T23:30:00.000Z");
console.log("UTC month:", date.getUTCMonth()); // 0 (January)
console.log("Local month:", date.getMonth()); // depends on timezone
At 23:30 UTC on Jan 31, it is already Feb 1 in UTC+5:30. getUTCMonth() stays 0 (January); getMonth() becomes 1 (February). Use UTC getters when reporting follows UTC months.
Applications
🚀 Common Use Cases
UTC dashboards — bucket metrics by UTC calendar month.
API date parts — assemble YYYY-MM-DD with UTC getters.
Billing cycles — align invoices on UTC month boundaries.
Log analysis — filter events by UTC month index.
Test fixtures — assert month parts from Date.UTC.
Same-month checks — pair with getUTCFullYear().
🧠 How getUTCMonth() Resolves the Month
1
Internal instant
The Date stores milliseconds since Unix epoch (UTC).
Storage
2
UTC projection
Engine reads calendar fields in UTC, not local time.
UTC
3
Extract month
Zero-based month index 0–11 is returned.
getUTCMonth
4
🌐
Format or compare
Add 1 for human months or pair with getUTCFullYear().
Important
📝 Notes
getUTCMonth() is zero-based: January = 0, December = 11.
Use getUTCMonth() + 1 for human month numbers 1–12.
Invalid dates propagate NaN—validate with Number.isNaN(date.getTime()).
Compare months across years with getUTCFullYear(), not month alone.
For full UTC strings, toISOString() is often simpler than manual getters.
Use UTC getters together; do not mix with local getters in one label.
Compatibility
Browser & Runtime Support
Date.prototype.getUTCMonth() has been available since the first JavaScript Date implementation (ES1). It works in every browser and Node.js.
✓ Baseline · ES1
Date.prototype.getUTCMonth()
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.getUTCMonth()Excellent
Bottom line: Safe everywhere. Remember zero-based indexing and pair with getUTCFullYear() for same-month logic.
Wrap Up
Conclusion
getUTCMonth() reads the zero-based month index from a JavaScript Date in UTC. Remember January = 0, add 1 for human month numbers, and choose UTC vs local getters based on your reporting rules.
Next, learn getUTCSeconds() for the UTC second component, or review getMonth() for local month reads.
Your foundation for UTC month reads in JavaScript.
5
Core concepts
📝01
Syntax
date.getUTCMonth()
API
🔢02
0–11
Jan = 0.
Range
🌐03
UTC
Not local.
Timezone
➕04
+ 1
Human 1–12.
Convert
⚠05
+ year
Same month.
Compare
❓ Frequently Asked Questions
An integer from 0 to 11 representing the month in the Date object's UTC timezone. 0 is January, 1 is February, … 11 is December.
JavaScript follows the same zero-based month index as Date.UTC's second argument and the local getMonth() method. Add 1 when you need human-readable month numbers 1–12.
getUTCMonth() uses UTC rules. getMonth() uses local timezone rules. Near midnight on month boundaries they can differ.
NaN. Validate with Number.isNaN(date.getTime()) before using the result.
Use Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }) for locale-aware names, or map getUTCMonth() to an array of month strings.
Yes. new Date(Date.UTC(2026, 2, 15)) creates March 15 UTC and getUTCMonth() returns 2—the same zero-based index you passed in.
Did you know?
March is index 2, not 3, in both Date.UTC and getUTCMonth(). The zero-based rule catches many beginners when building UTC date strings.