JavaScript Date getDate() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Date

Definition

Date.prototype.getDate() returns the day of the month (1–31) for a date in local time. It is read-only and does not change the Date.

Remember
date.getDate()

→ integer 1 … 31   (local calendar day)
→ NaN              (if the Date is invalid)

getDate()  → day of month
getDay()   → weekday (0–6)
getUTCDate() → same idea, but UTC

Syntax

Call date.getDate. Start with this line.

JavaScript
date.getDate()
CallWhat it does
date.getDate()Primary signature.
date.getDate(...)Call with the arguments your case needs.

Built into JavaScript. Call getDate(...) on a Date instance — no import required.

Library declarations
JavaScript
date.getDate()

Parameters

This method has no parameters beyond those shown in the signature.

Return Value

Return ValueDescription
*The value returned by date.getDate().

JavaScript Examples

Example 1 — Read the Day of the Month

Call getDate() on a fixed local date (month index is zero-based).

JavaScript
const birthday = new Date(1975, 7, 19); // Aug 19, 1975

console.log(birthday.getDate()); // 19
Try It Yourself

How It Works

  1. Build a local date. new Date(1975, 7, 19) means year 1975, month index 7 (August), day 19.
  2. Read the calendar day. getDate() returns 19 — the day-of-month in local time.
  3. Hours are ignored here. Time-of-day does not change this getter’s result for that calendar day.
  4. No side effects. The Date is unchanged; getDate only reads.

Example 2 — getDate() vs getDay()

Same date, two getters — month day versus weekday index.

JavaScript
const xmas = new Date(1995, 11, 25); // Dec 25, 1995

console.log(xmas.getDate()); // 25  (day of month)
console.log(xmas.getDay());  // 1   (Monday)
Try It Yourself

How It Works

  1. Create Dec 25. Month index 11 is December.
  2. Ask for the calendar number. getDate() → 25.
  3. Ask for the weekday. getDay() → 1 (Sunday = 0, so Monday = 1).
  4. Rule of thumb. Need “the 25th”? Use getDate. Need “Monday”? Use getDay.

Example 3 — Add Days with setDate(getDate() + n)

Shift a date forward; overflow rolls into the next month automatically.

JavaScript
const future = new Date(2026, 0, 28); // Jan 28, 2026

future.setDate(future.getDate() + 7);

console.log(future.getDate());  // 4
console.log(future.getMonth()); // 1 (February)
Try It Yourself

How It Works

  1. Start on Jan 28. getDate() is 28.
  2. Add seven days. setDate(28 + 7) asks for day 35 of January.
  3. Engine normalizes. January has 31 days, so day 35 becomes February 4.
  4. Read back. getDate() is now 4; month index is 1 (February).

Browser & Runtime Support

Date.prototype.getDate() has been in JavaScript since ES1. It is Baseline and works in every modern browser and Node.js — no polyfill needed.

✓ Baseline · ES1

Date.prototype.getDate()

Supported everywhere Date exists: Chrome, Firefox, Safari, Edge, Internet Explorer, and all Node.js versions.

99% Universal API
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
Date.getDate() Excellent

Bottom line: Safe to use in any environment. Focus on timezone correctness (local vs UTC) rather than feature support. See also the MDN getDate() reference.

Frequently Asked Questions

An integer from 1 to 31 for the day of the month in local time. It is the calendar date number (for example 19), not the weekday.
getDate() returns the day of the month (1–31). getDay() returns the weekday index (0–6, Sunday = 0). Remember: Date = calendar day, Day = weekday.
getDate() uses the local timezone. getUTCDate() uses UTC. Near midnight they can differ by one day across timezones.
NaN. Validate with Number.isNaN(date.getTime()) before using the result in UI or math.
No for a valid Date — the range is 1–31. If you see NaN, the Date is invalid.
Use setDate(getDate() + n). Overflow rolls into the next month automatically. Example: date.setDate(date.getDate() + 7) adds seven days.

Next: getDay()

Learn how to read the weekday index from Sunday (0) through Saturday (6).

getDay() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful