JavaScript Date getUTCMonth() Method

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

What You’ll Learn

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

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.

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".

📝 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

⚡ Quick Reference

GoalCode
Current UTC month indexnew Date().getUTCMonth()
Month from UTC partsnew Date(Date.UTC(2026, 2, 15)).getUTCMonth() → 2
Human month 1–12date.getUTCMonth() + 1
Local month indexdate.getMonth()
UTC yeardate.getUTCFullYear()
Valid date check!Number.isNaN(date.getTime())

📋 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

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

March 15, 2026 UTC is month index 2—not 3.

JavaScript
const march15Utc = new Date(Date.UTC(2026, 2, 15));
const monthIndex = march15Utc.getUTCMonth();

console.log(monthIndex); // 2 (March)
Try It Yourself

How It Works

Date.UTC’s second argument uses the same zero-based index as getUTCMonth(). Index 2 always means March in UTC.

📈 Practical Patterns

Human numbers, names, validation, and local comparison.

Example 2 — Convert to Human Month Numbers (1–12)

Add one when you need the calendar month number people expect.

JavaScript
const date = new Date(Date.UTC(2026, 1, 15));
const monthNumber = date.getUTCMonth() + 1;

console.log("Calendar month:", monthNumber); // 2 (February)
Try It Yourself

How It Works

getUTCMonth() is zero-based; human calendars are one-based. The + 1 adjustment is the most common conversion in UTC reporting.

Example 3 — Map the UTC Index to a Month Name

Turn the numeric index into a readable English label.

JavaScript
const MONTHS = [
  "January", "February", "March", "April",
  "May", "June", "July", "August",
  "September", "October", "November", "December"
];

const date = new Date(Date.UTC(2026, 1, 15));
console.log("UTC month:", MONTHS[date.getUTCMonth()]);
// UTC month: February
Try It Yourself

How It Works

Array index aligns with getUTCMonth()—index 0 is January. For i18n, prefer Intl.DateTimeFormat with timeZone: "UTC".

Example 4 — Validate Before Calling getUTCMonth()

Guard against invalid Date objects that yield NaN.

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

console.log(safeGetUTCMonth(new Date(Date.UTC(2026, 1, 15))));  // 1
console.log(safeGetUTCMonth(new Date("not-a-date")));              // null
Try It Yourself

How It Works

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
Try It Yourself

How It Works

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.

🚀 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().

📝 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.

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 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.getUTCMonth() Excellent

Bottom line: Safe everywhere. Remember zero-based indexing and pair with getUTCFullYear() for same-month logic.

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.

💡 Best Practices

✅ Do

  • Remember January is index 0
  • Add 1 for human month numbers 1–12
  • Validate dates before calling getUTCMonth()
  • Pair with getUTCFullYear() for same-month checks
  • Use Date.UTC in tests for stable fixtures

❌ Don’t

  • Assume March is index 3
  • Assume getMonth() equals getUTCMonth()
  • Compare months without checking the year
  • Mix local and UTC getters in one label
  • Ignore NaN from bad date parses

Key Takeaways

Knowledge Unlocked

Five things to remember about Date.getUTCMonth()

Your foundation for UTC month reads in JavaScript.

5
Core concepts
🔢 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.

Continue to getUTCSeconds()

Learn how to read the second component (0–59) from a Date in UTC.

getUTCSeconds() 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