JavaScript Date toLocaleDateString() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Date

Definition

Date.prototype.toLocaleDateString() returns a language-sensitive string for the date portion of a Date in the local timezone (for example "12/20/2012" in en-US). With Intl support, it delegates to Intl.DateTimeFormat.

Remember
date.toLocaleDateString()
date.toLocaleDateString(locales)
date.toLocaleDateString(locales, options)

→ "12/20/2012"              (en-US example)
→ "20/12/2012"              (en-GB example)
→ "Invalid Date"            (if the Date is invalid)

toDateString()       → fixed English layout
toLocaleString()     → date + time (locale)
toLocaleTimeString() → time only (locale)

Syntax

Call date.toLocaleDateString. Start with this line.

JavaScript
date.toLocaleDateString(locales?, options?)
CallWhat it does
date.toLocaleDateString(locales?, options?)Primary signature.
date.toLocaleDateString(...)Call with the arguments your case needs.

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

Library declarations
JavaScript
date.toLocaleDateString(locales?, options?)

Parameters

ParameterDescription
localesOptional. BCP 47 tag or array of tags
optionsOptional. Fields like weekday, month, dateStyle

Return Value

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

JavaScript Examples

Example 1 — Format the Same Date in Two Locales

Compare US and British date order for December 20, 2012.

JavaScript
const date = new Date(2012, 11, 20); // Dec 20, 2012 (local)

console.log(date.toLocaleDateString("en-US")); // "12/20/2012"
console.log(date.toLocaleDateString("en-GB")); // "20/12/2012"
Try It Yourself

How It Works

  1. Build a local date. Month index 11 is December.
  2. Format for the US. en-US uses month/day/year → "12/20/2012".
  3. Format for Britain. en-GB uses day/month/year → "20/12/2012".
  4. Same instant, different labels. Choose the locale that matches your users.

Example 2 — Long Weekday and Month with Options

Pass an options object for a fuller German-style date line.

JavaScript
const date = new Date(2012, 11, 20);
const options = {
  weekday: "long",
  year: "numeric",
  month: "long",
  day: "numeric"
};

console.log(date.toLocaleDateString("de-DE", options));
// "Donnerstag, 20. Dezember 2012"
Try It Yourself

How It Works

  1. Start from the same date. December 20, 2012 in local time.
  2. Describe the fields. Long weekday and month, numeric year and day.
  3. Pass locale + options. German conventions assemble the readable sentence.
  4. Expect small engine differences. Exact punctuation/spacing can vary — use for display only.

Example 3 — Guard Against Invalid Dates

Check getTime() before formatting user input.

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

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

How It Works

  1. Create an invalid Date. Bad input yields a NaN time value.
  2. Detect early. Number.isNaN(bad.getTime()) is true.
  3. Show a clear message. Prefer "Bad input" over a confusing label.
  4. Without a guard. toLocaleDateString() returns the string "Invalid Date".

Browser & Runtime Support

Date.prototype.toLocaleDateString() itself dates to ES1. The locales and options parameters require the Intl API (widely available in modern browsers and Node.js).

✓ Baseline · Intl

Date.prototype.toLocaleDateString()

Basic method: everywhere Date exists. Locales/options: Chrome, Firefox, Safari, Edge, and modern Node.js with full Intl data.

98% Modern Intl support
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.toLocaleDateString() Excellent

Bottom line: Safe for modern UI. Feature-detect with typeof Intl !== "undefined" && Intl.DateTimeFormat if you must support very old engines. See also the MDN toLocaleDateString() reference.

Frequently Asked Questions

A language-sensitive string for the date portion in the local timezone (for example "12/20/2012" in en-US or "20/12/2012" in en-GB). Time is not included.
No. It formats only the calendar date. Use toLocaleString() for date and time, or toLocaleTimeString() for time alone.
toDateString() uses a fixed English-style layout. toLocaleDateString() follows Intl locale rules and accepts locales and options for flexible, user-facing labels.
locales is a BCP 47 tag (or array of tags). options customizes fields such as weekday, year, month, day, dateStyle, and timeZone. With Intl support, this matches Intl.DateTimeFormat.
No. Engines may insert non-breaking spaces or bidirectional marks. Treat the output as display text, not a stable interchange format.
It returns the string "Invalid Date". Validate with Number.isNaN(date.getTime()) before showing labels in UI.

Next: toLocaleString()

Learn how to format date and time together with locale-aware Intl options.

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