How to get the Day of the Month in JavaScript

avatar

Borislav Hadzhiev

Sun Oct 24 20211 min read

Get the Day of the Month in JavaScript #

To get the day of the month, use the new Date() constructor to create a date object and call the getDate() method on the result, e.g. new Date().getDate(). The getDate method returns an integer between 1 and 31 that represents the day of the month for a given date.

index.js
// 👇️ Current day of month const currentDayOfMonth = new Date().getDate(); console.log(currentDayOfMonth); // 👇️ Day of month for specific date const date = new Date(2025, 01, 24); const dayOfMonth = date.getDate(); console.log(dayOfMonth); // 👉️ 24

We used the new Date() constructor to get a date object, on which we can use the getDate method.

The get date method returns the day of the month (1-31) for a specific date.

If you need to get the current day of the month, don't pass any parameters to the new Date() constructor, when calling the getDate() method.

Further Reading #

Use the search field on my Home Page to filter through my more than 1,000 articles.