I try to use the date object from NodeJS v14.15.1. And when I instantiate the object with the year, month and day parameter. When I try to use the getDay() and getYear() method, I don't have the right number.
I really don't know what going on and why this method don't return what's I expected.
const date = new Date(2021, 4, 1) // I create a date object for 2021/04/01
console.log(date.getDay()) // This return 6 instead of 1
console.log(date.getYear()) // This return 121 instead if 2021