How to fix JavaScript Date.getDay() returns wrong day?

Sometimes, we want to fix JavaScript Date.getDay() returns wrong day.

In this article, we’ll look at how to fix JavaScript Date.getDay() returns wrong day.

How to fix JavaScript Date.getDay() returns wrong day?

To fix JavaScript Date.getDay() returns wrong day, we use the date’s getDate method to get the day of the month.

For instance, we write

const date = new Date().getDate();

to get the date of the month of today’s date with getDate.

Conclusion

To fix JavaScript Date.getDay() returns wrong day, we use the date’s getDate method to get the day of the month.