GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — Date.prototype.getUTCDay() - JavaScript | MDN

Date.prototype.getUTCDay()

Baseline
Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

  • See full compatibility
  • Learn more

The getUTCDay() method of Date instances returns the day of the week for this date according to universal time, where 0 represents Sunday.

Try it

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");

// Tuesday
console.log(date1.getUTCDay());
// Expected output: 2

// Wednesday
console.log(date2.getUTCDay());
// Expected output: 3

Syntax

js
getUTCDay()

Parameters

None.

Return value

An integer corresponding to the day of the week for the given date according to universal time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. Returns NaN if the date is invalid.

Examples

Using getUTCDay()

The following example assigns the weekday portion of the current date to the variable weekday.

js
const today = new Date();
const weekday = today.getUTCDay();

Specifications

Specification
ECMAScript® 2027 Language Specification
# sec-date.prototype.getutcday

Browser compatibility

See also

  • Date.prototype.getUTCDate()
  • Date.prototype.getDay()
  • Date.prototype.setUTCDate()

Help improve MDN

Learn how to contribute

This page was last modified on Jul 10, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.