Encodera

Thanks for reading!

Donate to the site — we work hard for you.

JavaScript reference

Date.prototype.toLocaleDateString

Formats a date without time by language rules.

Available since: ES1

Syntax

date.toLocaleDateString(locales, options)

Parameters

ParameterTypeDescription
localesstringOptional. The language and region, for example en-US, de-DE, ru-RU.
optionsobjectOptional. What to show: weekday, year, month, day, and also dateStyle and timeZone.

Return value

stringThe date without time, formatted by the language rules.

Examples

One day in different countries:

const date = new Date(2026, 2, 15);
 
console.log(date.toLocaleDateString('en-US'));
console.log(date.toLocaleDateString('de-DE'));
console.log(date.toLocaleDateString('en-GB'));

Output:

3/15/2026
15.3.2026
15/03/2026

With the month and weekday names:

const date = new Date(2026, 2, 15);
 
console.log(date.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }));
console.log(date.toLocaleDateString('en-US', { dateStyle: 'medium' }));

Output:

Sunday, March 15, 2026
Mar 15, 2026

Notes

Without locales the browser language is used, so different users see different results. To format many dates it is faster to create one Intl.DateTimeFormat.

See also

Related recipes

In the tutorial

  • Formatting with Intl — Locale-aware formatting of numbers, money, dates and plural words in JavaScript: toLocaleString, Intl.NumberFormat, Intl.DateTimeFormat and Intl.PluralRules.

Thanks for reading!

Donate to the site — we work hard for you.