formatting

Date.prototype.toLocaleDateString

Returns the date portion formatted for a given locale and options, without the time. For repeated formatting, cache an Intl.DateTimeFormat instead - it is significantly faster.

date.toLocaleDateString([locales[, options]])

Parameters

Parameter Purpose
locales BCP 47 tag like 'en-US', 'de-DE', or ['fr','en']
dateStyle 'full' | 'long' | 'medium' | 'short'
year/month/day 'numeric' | '2-digit' | 'long' | 'short' | 'narrow'
timeZone IANA zone like 'UTC' or 'America/New_York'

Examples

console.log(new Date('2026-07-19').toLocaleDateString('en-US', {timeZone:'UTC'})); // '7/19/2026'

US short

console.log(new Date('2026-07-19').toLocaleDateString('en-GB', {timeZone:'UTC'})); // '19/07/2026'

UK order

console.log(new Date('2026-07-19').toLocaleDateString('en-US', {dateStyle:'full', timeZone:'UTC'})); // 'Sunday, July 19, 2026'

full style

console.log(new Date('2026-07-19').toLocaleDateString('ja-JP', {timeZone:'UTC'})); // '2026/7/19'

Japanese

Gotcha

Output varies by browser/Node ICU data. For repeated formatting in a loop, use `new Intl.DateTimeFormat(locale, opts).format(d)` - orders of magnitude faster.

Related

← All JS Date methods · Math methods · Cron syntax