I suspect the issue might not be getDate vs getUTCDate, but how the date is created. Not entirely sure, but i might try logging out the full date and utc date for each in your console.log
Hi, I cannot replicate the issue. I tested it with the following code:
let same=0;
for (var year = 2014; year <= 2044; year++) {
var d = new Date(year, 0, 1);
if (d.getDay()===d.getUTCDay())
console.log(++same,'true');
if (d.getDay() === 0)
console.log("1st Jan is being a Sunday" + year);
if (d.getUTCDay() === 0)
console.log("UTC 1st Jan is being a Sunday" + year);
}
every year getDay() and getUTCDay() returns the same output.