Note: This might be a duplicate, but is more concise than other questions posted.
(new Date(2022,5,3)).getDay() returns 5. Expected is 3.
What is going on?
use getDate() (Reference)
You fall trap to bad naming of functions.
getDay() returns the weekday (values: 0 - 6)
getDate() returns the monthday