getUTCDate() returns the calendar day of the month (1–31) from a Date object in UTC. This guide covers syntax, five examples, comparisons with local getters, and safe UTC date patterns.
01
Syntax
date.getUTCDate()
02
Range
1 – 31
03
UTC
Not local
04
vs getDate
Can differ
05
Add days
setUTCDate pair
06
Validate
Invalid → NaN
Fundamentals
Introduction
Servers, databases, and APIs usually store instants in UTC. The JavaScript Date object stores one instant internally; UTC getters like getUTCDate() read calendar parts without applying your local timezone offset.
If you need the day in the user’s local timezone, use getDate() instead. Use getUTCDate() when you build UTC date strings or compare calendar days globally.
Concept
Understanding the getUTCDate() Method
Date.prototype.getUTCDate() is a zero-argument instance method. It never mutates the original Date—it only reads the UTC day-of-month component.
Pair it with getUTCMonth(), getUTCFullYear(), and getUTCHours() to assemble UTC parts, or use toISOString() when a full UTC string is enough.
💡
Beginner Tip
Memory hook: getUTCDate = UTC calendar date (15th). getUTCDay = UTC weekday (Tuesday / 2). The “Date” vs “Day” distinction matches the local getters.
Foundation
📝 Syntax
JavaScript
dateObj.getUTCDate()
Parameters
None.
Return value
Integer 1–31 for a valid date in UTC.
NaN if dateObj is an invalid Date.
Cheat Sheet
⚡ Quick Reference
Goal
Code
Today’s UTC calendar day
new Date().getUTCDate()
UTC day from parts
new Date(Date.UTC(2026, 2, 15)).getUTCDate() → 15
Local calendar day
date.getDate()
UTC weekday (0–6)
date.getUTCDay()
Add 7 UTC days
date.setUTCDate(date.getUTCDate() + 7)
Valid date check
!Number.isNaN(date.getTime())
Compare
📋 getUTCDate() vs Similar Methods
UTC getters mirror local getters. Pick the one that matches where your data is displayed or stored.
getUTCDate()
1–31
UTC day of month
getDate()
local
Local day of month
getUTCDay()
0–6
UTC weekday
toISOString()
…Z
Full UTC string
Hands-On
Examples Gallery
Open DevTools Console (F12) or use Try-it links. Fixed UTC dates use Date.UTC or ISO strings ending in Z for predictable results.
📚 Getting Started
Read the current UTC day-of-month from a new Date.
Example 1 — Get Today’s UTC Day of the Month
Call getUTCDate() on the current instant.
JavaScript
const now = new Date();
const utcDay = now.getUTCDate();
console.log("UTC day of month:", utcDay);
getUTCMonth() is zero-based like getMonth(), so add 1 before padding. For production APIs, toISOString() is usually simpler.
Example 5 — Compare getDate() and getUTCDate()
Near UTC midnight, local and UTC calendar days can differ.
JavaScript
// Jan 31, 2026 at 23:30 UTC
const date = new Date("2026-01-31T23:30:00.000Z");
console.log("UTC day:", date.getUTCDate()); // 31
console.log("Local day:", date.getDate()); // depends on timezone
At 23:30 UTC on Jan 31, it is already Feb 1 in UTC+5:30. getUTCDate() stays 31; getDate() becomes 1. This is why server UTC dates and local UI dates must not be mixed blindly.
Applications
🚀 Common Use Cases
API payloads — assemble UTC date parts for logs or exports.
Global dashboards — align daily metrics on UTC midnight boundaries.
Database rows — read UTC day from timestamps stored as UTC.
Unit tests — assert UTC parts with Date.UTC fixtures.
Debug panels — show both local and UTC calendar days side by side.
UTC arithmetic — shift days with setUTCDate(getUTCDate() + n).
🧠 How getUTCDate() Resolves the Day
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 day
UTC calendar day-of-month (1–31) is returned as an integer.
getUTCDate
4
🌐
Use in APIs
Format, compare, or feed into setUTCDate for UTC day math.
Important
📝 Notes
getUTCDate() is UTC; use getDate() for local UI labels.
Do not confuse with getUTCDay() (weekday index).
Invalid dates propagate NaN—validate with Number.isNaN(date.getTime()).
getUTCMonth() is zero-based; add 1 when building month numbers.
For full UTC strings, toISOString() is often simpler than manual getters.
Add UTC days with setUTCDate(getUTCDate() + n), not local setDate, when working in UTC.
Compatibility
Browser & Runtime Support
Date.prototype.getUTCDate() has been available since the first JavaScript Date implementation (ES1). It works in every browser and Node.js.
✓ Baseline · ES1
Date.prototype.getUTCDate()
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.getUTCDate()Excellent
Bottom line: Safe everywhere. Pair UTC getters together and avoid mixing them with local getters on the same formatted output.
Wrap Up
Conclusion
getUTCDate() reads the day-of-month from a JavaScript Date in UTC. Use it when your logic follows UTC calendar boundaries; use local getters or locale formatters when showing dates to end users.
Your foundation for UTC day-of-month reads in JavaScript.
5
Core concepts
📝01
Syntax
date.getUTCDate()
API
🔢02
1–31
UTC day of month.
Range
🌐03
UTC
Not local.
Timezone
🔄04
+ UTC days
setUTCDate idiom.
Math
⚠05
Not getUTCDay
Month vs week.
Pitfall
❓ Frequently Asked Questions
An integer from 1 to 31 representing the day-of-month according to Coordinated Universal Time (UTC). It is the UTC calendar date, not the local calendar date.
getUTCDate() reads the UTC calendar day. getDate() reads the local calendar day. Near midnight or across timezones they can differ by one day.
getUTCDate() returns the day of the month (1–31). getUTCDay() returns the day of the week in UTC (0–6, where 0 is Sunday). Do not confuse Date with Day.
NaN. Validate with Number.isNaN(date.getTime()) before relying on the result.
For sending dates to servers, prefer toISOString() or store epoch milliseconds. Use getUTCDate() when you are assembling UTC parts manually or teaching how UTC getters work.
Use setUTCDate(getUTCDate() + n). Like setDate, it normalizes month and year overflow automatically in UTC.
Did you know?
At 2026-01-31T23:30:00.000Z, getUTCDate() is always 31, but getDate() can be 1 in timezones ahead of UTC—that one-line comparison is a classic timezone bug demo.