Home >JavaScript >JavaScript reference – methods and objects >Date.prototype.toLocaleString()

Date.prototype.toLocaleString()

date.toLocaleString(locale, options)

Returns the date and time as a string by the conventions of the language. The timeZone option shows the same moment in another time zone.

Parameters

  • locale – e.g. 'en-US'.
  • options – the same as for toLocaleDateString() and toLocaleTimeString(), plus dateStyle and timeStyle ('full', 'long', 'medium', 'short').

Return value

A string.

Examples

const d = new Date(Date.UTC(2026, 6, 15, 14, 0));
console.log(d.toLocaleString('en-US'));
console.log(d.toLocaleString('en-US', { dateStyle: 'long', timeStyle: 'short' }));
console.log(d.toLocaleString('en-US', { timeZone: 'Asia/Tokyo', dateStyle: 'short', timeStyle: 'short' }));
console.log(d.toLocaleString('en-US', { timeZone: 'UTC', timeStyle: 'short' }));

Output:

7/15/2026, 4:00:00 PM
July 15, 2026 at 4:00 PM
7/15/26, 11:00 PM
2:00 PM

Things to watch out for

  • Always pass the language ('en-US'), otherwise the language of the browser or the server is used.
  • The exact form (spaces, abbreviations) comes from the language data each browser has in its version – it can differ slightly between browsers and their versions. Use the result only for display, not for further processing.
  • dateStyle and timeStyle cannot be combined with the individual options (day, hour…) – it throws a TypeError.

Browser support

Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 1, Firefox 1, Safari 1; Node.js 0.10.0. As of October 2026 (MDN browser-compat-data).

Related:
Date.prototype.toLocaleDateString()
Intl.DateTimeFormat
Date.prototype.toISOString()