let day = d.getUTCDay();
Definition and Usage
getUTCDay() returns the day of the week (0 to 6) for a date.
getUTCDay() returns the day of the week according to universal time.
Sunday = 0, Monday = 1, ... (See below):
Get the name of the weekday (not just a number):
const weekday = new Array();
weekday = "Sunday";
weekday = "Monday";
weekday = "Tuesday";
weekday = "Wednesday";
weekday = "Thursday";
weekday = "Friday";
weekday = "Saturday";
let day = weekday[d.getUTCDay()];
UTC (Universal Time Coordinated) is the time set by the World Time Standard.
UTC time is the same as GMT time (Greenwich Mean Time).
It is fully supported in all browsers:
The weekday of tha date (0 to 6), according to UTC.