DEV Community

loading...

Discussion on: All That You Need To Know About Date Object In JavaScript

Collapse
btlm profile image
btlm

Probably you have switched descriptions for getDate() and getDay()

2.getDate() : Returns a integer representing the date (0 to 6), 0 represents Sunday, it cannot be changed.

3.getDay() : Returns the day of the week for the local time(1 to 31).

getDate() returns 1 to 31 (day of month) and getDay() returns 0 to 6 (day of week) (switched values in your descr)

Anyways great article, thank you :)

Collapse
kiranrajvjd profile image
Kiran Raj R Author

rectified, thank you