Favorites

JavaScript Date.prototype.getDate() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Date.prototype.getDate()
JavaScript Date Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The getDate() method returns the day of the month (1 to 31) of a date.

Description

The getDate() method returns the day of the month, from 1 to 31, in local time. Don't confuse it with getDay(), which returns the day of the week.

Day 0 of a month means the last day of the previous month, so new Date(year, month + 1, 0).getDate() gives the number of days in any month, including leap years for February.

Like the other get...() methods without "UTC" in their name, it uses the time zone of the user's device, so the same moment can give different results for users in different places. Each has a getUTC...() counterpart for UTC, and for showing a date in a particular time zone, toLocaleString() with the timeZone option is the easiest approach.

Syntax

date.getDate()

Return Value

The day of the month in local time, from 1 to 31.

Example

const d = new Date(2026, 10, 28);
console.log(d.getDate());
const lastDay = new Date(2026, 2, 0).getDate();   // day 0 of March = last day of February
console.log('Days in Feb 2026:', lastDay);

Browser Support

The following information will show you the current browser support for the Date.prototype.getDate() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee