getUTCDay() returns the day of the week (0–6) from a Date object in UTC. This guide covers syntax, the Sunday–Saturday index table, five examples, comparisons with local getters, and safe UTC scheduling patterns.
01
Syntax
date.getUTCDay()
02
Range
0 – 6
03
UTC
Not local
04
vs getUTCDate
Week vs month
05
Names
Map index
06
Validate
Invalid → NaN
Fundamentals
Introduction
Global apps often bucket data by UTC weekdays—for example, “reporting week starts on UTC Monday.” The JavaScript Date object stores one instant; getUTCDay() reads the weekday index according to UTC, not the user’s local timezone.
If you need the weekday in the user’s locale, use getDay() or Intl.DateTimeFormat. Use getUTCDay() when your logic follows UTC calendar boundaries.
Concept
Understanding the getUTCDay() Method
Date.prototype.getUTCDay() is a zero-argument instance method. It never mutates the original Date—it only reads the UTC weekday component.
The return value is always an integer: 0 = Sunday through 6 = Saturday. To show a name, map the index to a string array or use locale formatters with timeZone: "UTC".
💡
Beginner Tip
Memory hook: getUTCDay = UTC weekday (Monday / 1). getUTCDate = UTC calendar date number (15th). The “Day” vs “Date” pattern matches the local getters.
Foundation
📝 Syntax
JavaScript
dateObj.getUTCDay()
Parameters
None.
Return value
Integer 0–6 for a valid date in UTC (0 = Sunday).
NaN if dateObj is an invalid Date.
Weekday index table
0 — Sunday
1 — Monday
2 — Tuesday
3 — Wednesday
4 — Thursday
5 — Friday
6 — Saturday
Cheat Sheet
⚡ Quick Reference
Goal
Code
Current UTC weekday index
new Date().getUTCDay()
Weekday from UTC parts
new Date(Date.UTC(2024, 1, 26)).getUTCDay() → 1
Local weekday index
date.getDay()
UTC day of month
date.getUTCDate()
UTC weekend check
const d = date.getUTCDay(); d === 0 || d === 6
Valid date check
!Number.isNaN(date.getTime())
Compare
📋 getUTCDay() vs Similar Methods
UTC getters mirror local getters. Pick the one that matches where your data is displayed or stored.
getUTCDay()
0–6
UTC weekday
getDay()
local
Local weekday
getUTCDate()
1–31
UTC day of month
Intl + UTC
"Monday"
Localized name
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 UTC weekday index from a known calendar date.
Example 1 — Get the UTC Weekday Index from a Fixed Date
February 26, 2024 is a Monday in UTC—getUTCDay() returns 1.
Global batch jobs often skip UTC weekends for maintenance windows. Use getUTCDay(), not getDay(), when the rule is defined in UTC.
Example 5 — Compare getDay() and getUTCDay()
Near UTC midnight, local and UTC weekdays can differ.
JavaScript
// Jan 31, 2026 at 23:30 UTC (Saturday in UTC)
const date = new Date("2026-01-31T23:30:00.000Z");
console.log("UTC weekday:", date.getUTCDay()); // 6
console.log("Local weekday:", date.getDay()); // depends on timezone
At 23:30 UTC on Saturday Jan 31, it is already Sunday in UTC+5:30. getUTCDay() stays 6 (Saturday); getDay() becomes 0 (Sunday). Pick the getter that matches your business rule.
Applications
🚀 Common Use Cases
UTC cron jobs — run tasks only on specific UTC weekdays.
Global analytics — bucket events by UTC weekday index.
Maintenance windows — skip UTC Saturday/Sunday deploys.
API logs — label timestamps with UTC weekday for support.
Recurring UTC events — “every UTC Tuesday” logic.
Debug panels — show local and UTC weekday side by side.
🧠 How getUTCDay() Resolves the Weekday
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 weekday
UTC day-of-week index 0–6 is returned as an integer.
getUTCDay
4
🌐
Use in logic
Map to names, branch on weekends, or compare with local getters.
Important
📝 Notes
getUTCDay() is UTC; use getDay() for local UI rules.
Do not confuse with getUTCDate() (day of month 1–31).
Sunday is 0, not 7.
Invalid dates propagate NaN—validate with Number.isNaN(date.getTime()).
Locale first-day-of-week settings do not change the numeric index—only how you label it.
For localized weekday names in UTC, use Intl.DateTimeFormat with timeZone: "UTC".
Compatibility
Browser & Runtime Support
Date.prototype.getUTCDay() has been available since the first JavaScript Date implementation (ES1). It works in every browser and Node.js.
✓ Baseline · ES1
Date.prototype.getUTCDay()
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.getUTCDay()Excellent
Bottom line: Safe everywhere. Use UTC getters together for global rules; use local getters when showing dates to end users.
Wrap Up
Conclusion
getUTCDay() reads the weekday index from a JavaScript Date in UTC. Map the 0–6 result to names, distinguish it from getUTCDate(), and choose UTC vs local getters based on your scheduling rules.
Next, learn getUTCFullYear() for the UTC year component, or review getDay() for local weekday logic.
Your foundation for UTC weekday reads in JavaScript.
5
Core concepts
📝01
Syntax
date.getUTCDay()
API
🔢02
0–6
Sun = 0.
Range
🌐03
UTC
Not local.
Timezone
📅04
Not getUTCDate
Week vs date.
Pitfall
🔄05
Weekend
0 or 6.
Pattern
❓ Frequently Asked Questions
An integer from 0 to 6 representing the day of the week in UTC. 0 is Sunday, 1 is Monday, … 6 is Saturday. It returns an index, not a name string.
getUTCDay() returns the weekday index (0–6). getUTCDate() returns the day of the month (1–31). Remember Day = weekday, Date = calendar date number—the same naming pattern as the local getters.
getUTCDay() uses UTC rules. getDay() uses local timezone rules. Near midnight or across timezones they can differ by one day.
Historical ECMAScript convention follows US-style calendars where Sunday is index 0. Map the number to labels yourself or use Intl.DateTimeFormat with timeZone: 'UTC' for locale-aware weekday names.
NaN. Validate with Number.isNaN(date.getTime()) before using the result in conditionals or array lookups.
const day = date.getUTCDay(); const isWeekend = day === 0 || day === 6; // Sunday or Saturday in UTC.
Did you know?
At 2026-01-31T23:30:00.000Z, getUTCDay() is always 6 (Saturday), but getDay() can be 0 (Sunday) in timezones ahead of UTC—the same instant, different weekday labels.