JavaScript Date getUTCDay() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Date

Definition

Date.prototype.getUTCDay() returns the day of the week as an integer 0–6 in UTC, where 0 is Sunday and 6 is Saturday. It is read-only and does not change the Date.

Remember
date.getUTCDay()

0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday

→ NaN if the Date is invalid

getUTCDay()  → weekday in UTC
getDay()     → weekday in local time
getUTCDate() → day of month in UTC

Syntax

Call date.getUTCDay. Start with this line.

JavaScript
date.getUTCDay()
CallWhat it does
date.getUTCDay()Primary signature.
date.getUTCDay(...)Call with the arguments your case needs.

Built into JavaScript. Call getUTCDay(...) on a Date instance — no import required.

Library declarations
JavaScript
date.getUTCDay()

Parameters

ParameterDescription
Name mappingOptional. Array index or Intl with UTC timezone

Return Value

Return ValueDescription
*The value returned by date.getUTCDay().

JavaScript Examples

Example 1 — Read the UTC Weekday Index

Build a UTC instant with Date.UTC, then call getUTCDay().

JavaScript
const xmas = new Date(Date.UTC(1995, 11, 25)); // Dec 25, 1995 UTC

console.log(xmas.getUTCDay()); // 1  (Monday)
Try It Yourself

How It Works

  1. Build a UTC date. Date.UTC(1995, 11, 25) is December 25, 1995 in UTC (month index 11).
  2. Read the weekday. getUTCDay() returns 1 — Monday in the 0–6 scale.
  3. Scale reminder. 0 = Sunday, so Monday lands at 1.
  4. No side effects. The Date is unchanged; getUTCDay only reads.

Example 2 — Opposite Offsets, Different UTC Weekdays

Same wall-clock label with GMT+11 vs GMT-11 maps to Tuesday vs Wednesday in UTC.

JavaScript
const date1 = new Date("August 19, 1975 23:15:30 GMT+11:00");
const date2 = new Date("August 19, 1975 23:15:30 GMT-11:00");

console.log(date1.getUTCDay()); // 2  (Tuesday)
console.log(date2.getUTCDay()); // 3  (Wednesday)
Try It Yourself

How It Works

  1. Parse with an offset. Each string includes a timezone offset in the text.
  2. GMT+11 case. UTC is still Tuesday → 2.
  3. GMT−11 case. UTC has rolled to Wednesday → 3.
  4. Lesson. The same “local” clock label is not always the same UTC weekday — use getUTCDay() when UTC is the contract.

Example 3 — Map the UTC Index to a Weekday Name

Use the return value as an index into a Sunday-first names array.

JavaScript
const dayNames = [
  "Sunday", "Monday", "Tuesday", "Wednesday",
  "Thursday", "Friday", "Saturday"
];

const d = new Date(Date.UTC(2026, 0, 4)); // Jan 4, 2026 UTC
const index = d.getUTCDay();

console.log(index);           // 0
console.log(dayNames[index]); // "Sunday"
Try It Yourself

How It Works

  1. List the seven names. Index 0 must be Sunday to match getUTCDay().
  2. Read the UTC index. January 4, 2026 UTC is a Sunday → 0.
  3. Look up the label. dayNames[0] → "Sunday".
  4. For real i18n. Prefer Intl.DateTimeFormat with { weekday: "long", timeZone: "UTC" }.

Browser & Runtime Support

Date.prototype.getUTCDay() has been in JavaScript since ES1. It is Baseline and works in every modern browser and Node.js — no polyfill needed.

✓ Baseline · ES1

Date.prototype.getUTCDay()

Supported everywhere Date exists: Chrome, Firefox, Safari, Edge, Internet Explorer, and all Node.js versions.

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

Bottom line: Safe to use in any environment. Focus on UTC vs local correctness and Sunday-first indexing. See also the MDN getUTCDay() reference.

Frequently Asked Questions

An integer from 0 to 6 for the weekday in UTC: 0 is Sunday, 1 is Monday, … 6 is Saturday. It returns a number, 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 number.
getUTCDay() uses UTC. getDay() uses the local timezone. Near midnight they can differ by one weekday across timezones.
ECMAScript uses Sunday as index 0 for both getDay() and getUTCDay(). Map labels yourself, or use Intl.DateTimeFormat with timeZone: "UTC".
NaN. Validate with Number.isNaN(date.getTime()) before using the result in conditions or array lookups.
const day = date.getUTCDay(); const isWeekend = day === 0 || day === 6; // Sunday or Saturday in UTC.

Next: getUTCFullYear()

Learn how to read the full year from a Date in UTC.

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

11 people found this page helpful