JavaScript Date toDateString() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Date

Definition

Date.prototype.toDateString() returns a string for the date portion of a Date in local time — weekday, month, day, and year — with no clock time. It is read-only and does not change the Date.

Remember
date.toDateString()

→ "Wed Jul 28 1993"     (local date only)
→ "Invalid Date"        (if the Date is invalid)

Format (English abbreviations, spaces):
  weekday  month  day  year
  ddd      mmm    dd   yyyy

toTimeString()  → time only
toString()      → date + time
toUTCString()   → UTC date+time text

Syntax

Call date.toDateString. Start with this line.

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

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

Library declarations
JavaScript
date.toDateString()

Parameters

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

Return Value

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

JavaScript Examples

Example 1 — Basic toDateString() Output

Format a fixed local date (month index is zero-based) as a readable string.

JavaScript
const event = new Date(1993, 6, 28); // Jul 28, 1993 (local)

console.log(event.toDateString()); // "Wed Jul 28 1993"
Try It Yourself

How It Works

  1. Build a local date. new Date(1993, 6, 28) is July 28, 1993 (month index 6).
  2. Format the date portion. toDateString() returns weekday + month + day + year.
  3. No time in the result. Hours and minutes are omitted on purpose.
  4. No side effects. The Date is unchanged; the method only returns a string.

Example 2 — toDateString() vs toString()

Same instant: date-only string versus the full local datetime string.

JavaScript
const event = new Date(1993, 6, 28, 14, 39, 7);

console.log(event.toDateString()); // "Wed Jul 28 1993"
console.log(event.toString());     // "Wed Jul 28 1993 14:39:07 GMT±…"
Try It Yourself

How It Works

  1. Create a datetime. Includes both calendar day and local clock time.
  2. Take the date slice. toDateString() keeps "Wed Jul 28 1993".
  3. See the full label. toString() appends time and timezone text (exact text varies by region).
  4. Rule of thumb. Want calendar only? Use toDateString(). Want both? Use toString().

Example 3 — Guard Against Invalid Dates

Check getTime() before showing a date label to users.

JavaScript
const bad = new Date("not-a-date");

if (Number.isNaN(bad.getTime())) {
  console.log("Bad input");
} else {
  console.log(bad.toDateString());
}
// without the guard: bad.toDateString() → "Invalid Date"
Try It Yourself

How It Works

  1. Parse bad input. new Date("not-a-date") creates an invalid Date.
  2. Detect with getTime. Number.isNaN(bad.getTime()) is true.
  3. Show a clear message. Log or display "Bad input" instead of a confusing label.
  4. Why it matters. Without a guard, toDateString() returns the string "Invalid Date".

Browser & Runtime Support

Date.prototype.toDateString() 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.toDateString()

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.toDateString() Excellent

Bottom line: Safe to use in any environment. Remember local vs UTC and prefer ISO for interchange. See also the MDN toDateString() reference.

Frequently Asked Questions

A string for the local calendar date only — weekday, month, day, and year — with no time. Example: "Wed Jul 28 1993". Invalid dates return "Invalid Date".
Local time. It formats the date in the runtime’s local timezone. For UTC text, use toUTCString() or toISOString().
toDateString() returns only the date portion. toString() returns date + time + timezone offset (and often a timezone name).
toDateString() uses a fixed English-style layout (ddd mmm dd yyyy). toLocaleDateString() follows Intl locale rules and accepts formatting options.
No. It is read-only — it returns a new string and leaves the Date unchanged.
No. The format is for display/debugging, not a portable interchange format. Prefer ISO 8601 (toISOString) or epoch milliseconds for storage and parsing.

Next: toISOString()

Learn how to serialize a Date as a portable UTC ISO 8601 string for APIs and storage.

toISOString() 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