Intl.DateTimeFormat is a JavaScript API for formatting dates and times according to specific locales and options. It is natively supported in modern browsers and does not require external libraries for basic formatting.

Key Features

  • Locale Support: Accepts BCP 47 language tags (e.g., "en-US", "fr-FR") or an array of tags for fallbacks.

  • Customizable Formatting: Options like dateStyle, timeStyle, weekday, month, day, hour, minute, second, and timeZone allow precise control.

  • Time Zone Handling: Use the timeZone option to format dates in a specific time zone (e.g., "America/New_York", "UTC").

  • Time Format: Use hour12: false for 24-hour format or hour12: true for 12-hour format.

  • Output: Returns a formatted string based on the specified locale and options.

Example Usage

const date = new Date(2024, 3, 29, 5, 30, 20);

// Format in US English with local time zone
new Intl.DateTimeFormat('en-US', {
  year: 'numeric',
  month: 'long',
  day: 'numeric',
  hour: '2-digit',
  minute: '2-digit',
  timeZoneName: 'short'
}).format(date);
// → "April 29, 2024, 5:30 AM PDT"

// Format in UTC
new Intl.DateTimeFormat('en-US', {
  timeZone: 'UTC',
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: '2-digit',
  minute: '2-digit'
}).format(date);
// → "04/29/2024, 05:30"

Best Practices

  • Use Intl.DateTimeFormat() with new or without — both work.

  • For consistent behavior across environments, explicitly set timeZone instead of relying on defaults.

  • Use timeStyle and dateStyle (e.g., "full", "long", "medium", "short") for predefined formats.

  • The API is well-established and supported in all modern browsers since 2017.

Note: The Intl.DateTimeFormat constructor is part of the ECMAScript Internationalization API and is not a polyfill — it’s native JavaScript. For older browsers, use the formatjs polyfill to ensure compatibility.

This is very close to being off–topic as opinion based, but here goes anyway.

Which one of these should I use?

Date.prototype.toLocaleString was originally solely implementation dependent and varied quite a bit across browsers. When support for the Intl object was added (ECMAScript 2015, ed 6) then toLocaleString was allowed to support the same options. While support isn't mandated by ECMA-262, probably all current implementations support it.

Note that this did not remove the allowed implementation variability, it just provided some formatting options based on language, region and dialect (and also timezone options based on the IANA time zone database identifiers and values).

The Intl object (and hence toLocaleString) is based on ECMA-402, which doesn't strictly specify formatting, so there is still some room for implementations to differ. The biggest differences are in regard to timezone names (for which there is no standard) and placement of commas, spaces, etc.

However, for most practical purposes, whether you use the Intl object or toLocaleString is up to you, I don't think there's any technical reason to prefer one over the other. While the results for both should be identical for a particular implementation, don't expect the resulting string to be exactly identical across implementations or to conform to a particular format for a given BCP 47 language tag.

Answer from RobG on Stack Overflow
Discussions

JavaScript Intl.DateTimeFormat.format vs Date.toLocaleString - Stack Overflow
Intl.DateTimeFormat.prototype.format is designed for the use of formatting large groups of Dates - rather than setting the locale and options every time, you set them once and use the resulting format function from then on. More on stackoverflow.com
🌐 stackoverflow.com
Mastering date formatting using Intl.DateTimeFormat in JavaScript
I have created a dateformat module based on Intl.DateTimeFormat. Maybe useful. More on reddit.com
🌐 r/javascript
4
13
May 29, 2024
Ability to specify a custom format for Intl.DateTimeFormat
(Apologies if this is the wrong way to approach this or if it's been covered before, though I couldn't see it if so) As best I can tell, Intl.DateTimeFormat doesn't have any ability to ... More on github.com
🌐 github.com
18
March 10, 2021
How to format a JavaScript date object using Intl.DateTimeFormat - Stack Overflow
I am trying to show a date in a string format like it's done in PHP (using date()). let checkoutDate = new Date(); var formatter = new Intl.DateTimeFormat('en-us', { weekday: 'long', year: 'n... More on stackoverflow.com
🌐 stackoverflow.com
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › DateTimeFormat › DateTimeFormat
Intl.DateTimeFormat() constructor - JavaScript | MDN
January 21, 2026 - In basic use without specifying a locale, DateTimeFormat uses the default locale and default options. ... const date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0)); // toLocaleString without arguments depends on the implementation, // the default locale, and the default time zone console.log(new Intl.DateTimeFormat().format(date)); // "12/19/2012" if run with en-US locale (language) and time zone America/Los_Angeles (UTC-0800)
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-intl-datetimeformat-format-method
JavaScript Intl DateTimeFormat format() Method - GeeksforGeeks
July 12, 2025 - The Intl.DateTimeFormat format() method in JavaScript formats dates and times according to a specified locale and options.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Guides › Date_and_time_formats
Using date and time formats in HTML - HTML | MDN
July 9, 2025 - The Intl.DateTimeFormat object for formatting dates and times for a given locale · Was this page helpful to you? Yes · No Learn how to contribute · This page was last modified on Jul 9, 2025 by MDN contributors.
🌐
Format.JS
formatjs.github.io › docs › polyfills › intl-datetimeformat
Intl Datetimeformat | FormatJS
import '@formatjs/intl-datetimeformat/polyfill.js' import '@formatjs/intl-datetimeformat/add-golden-tz.js' This polyfill supports UTC offset timezone identifiers as specified in ECMA-402 (ES2026). You can use offset-based timezone strings in addition to IANA timezone names.
Find elsewhere
Top answer
1 of 4
27

This is very close to being off–topic as opinion based, but here goes anyway.

Which one of these should I use?

Date.prototype.toLocaleString was originally solely implementation dependent and varied quite a bit across browsers. When support for the Intl object was added (ECMAScript 2015, ed 6) then toLocaleString was allowed to support the same options. While support isn't mandated by ECMA-262, probably all current implementations support it.

Note that this did not remove the allowed implementation variability, it just provided some formatting options based on language, region and dialect (and also timezone options based on the IANA time zone database identifiers and values).

The Intl object (and hence toLocaleString) is based on ECMA-402, which doesn't strictly specify formatting, so there is still some room for implementations to differ. The biggest differences are in regard to timezone names (for which there is no standard) and placement of commas, spaces, etc.

However, for most practical purposes, whether you use the Intl object or toLocaleString is up to you, I don't think there's any technical reason to prefer one over the other. While the results for both should be identical for a particular implementation, don't expect the resulting string to be exactly identical across implementations or to conform to a particular format for a given BCP 47 language tag.

2 of 4
11

If you re-use the same format a lot of times, re-using Intl.DateTimeFormat object seems to be better from a performance perspective.

const format =  {
    weekday: 'long',
    month: 'long',
    day: '2-digit',
};
const dateTimeFormat = new Intl.DateTimeFormat('en', format);
const start1 = performance.now();
for (let i = 0; i < 10000; i++) dateTimeFormat.format(new Date());
console.log('re-use Intl.DateTimeFormat', performance.now() - start1);

const start2 = performance.now();
for (let i = 0; i < 10000; i++) new Date().toLocaleString('en', format);
console.log('use toLocaleString', performance.now() - start2);

When I run this snippet in Chrome 105, it gives me a result like this:

re-use Intl.DateTimeFormat 17.299999952316284
use toLocaleString 876.0999999046326
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › DurationFormat › format
Intl.DurationFormat.prototype.format() - JavaScript | MDN
October 10, 2025 - const duration = { hours: 11, minutes: 30, seconds: 12, milliseconds: 345, microseconds: 600, }; new Intl.DurationFormat("en", { style: "digital" }).format(duration); // "11:30:12.3456" new Intl.DurationFormat("en", { style: "digital", fractionalDigits: 5 }).format( duration, ); // "11:30:12.34560" new Intl.DurationFormat("en", { style: "digital", fractionalDigits: 3 }).format( duration, ); // "11:30:12.346"
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › RelativeTimeFormat › format
Intl.RelativeTimeFormat.prototype.format() - JavaScript | MDN
const rtf = new Intl.RelativeTimeFormat("en", { style: "short" }); console.log(rtf.format(3, "quarter")); // Expected output: "in 3 qtrs." console.log(rtf.format(-1, "day")); // Expected output: "1 day ago" console.log(rtf.format(10, "seconds")); // Expected output: "in 10 sec."
🌐
Rafaelcamargo
rafaelcamargo.com › blog › mastering-date-formatting-using-intl-date-time-format-in-javascript
Mastering date formatting using Intl.DateTimeFormat in JavaScript
May 29, 2024 - const date = new Date(2024, 3, 29, 0); const opts = { day: 'numeric', year: 'numeric' }; Intl.DateTimeFormat('en-US', { ...opts, month: 'long' }).format(date); // → April 29, 2024 Intl.DateTimeFormat('en-US', { ...opts, month: 'short' }).format(date); // → Apr 29, 2024 Intl.DateTimeFormat('en-US', { ...opts, month: 'narrow' }).format(date); // → A 29, 2024
🌐
GitHub
github.com › tc39 › ecma402 › issues › 554
Ability to specify a custom format for Intl.DateTimeFormat · Issue #554 · tc39/ecma402
March 10, 2021 - new Intl.DateTimeFormat('en-CA', {formatString: '%M %d %y, %h:%m:%s %a'}).format(new Date()); 'Mar.
Author   sazzer
🌐
Philna
philna.sh › blog › 2021 › 02 › 22 › display-dates-in-your-users-time-zone
How to display dates in your user's time zone with the Intl API
February 22, 2021 - Now we get the date in mm/dd/yyyy format, far and away the worst format. But, since Intl.DateTimeFormat knows international preferences for this, I can provide the language and the result will be formatted in the way the user expects and I never have to see a date with the month in the most ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › ListFormat
Intl.ListFormat - JavaScript | MDN
July 10, 2025 - Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current Intl.ListFormat object.
🌐
Medium
medium.com › @vandanacherukuru › javascript-internalization-intl-datetimeformat-e8c0bb91a904
JavaScript Internationalization (Intl.DateTimeFormat) | by Vandana Rao Cherukuru | Medium
April 1, 2025 - The Intl.DateTimeFormat object in JavaScript is used to format dates and times in a locale-sensitive manner. It allows you to control how…
🌐
Reality Ripple
udn.realityripple.com › docs › Web › JavaScript › Reference › Global_Objects › Intl › DateTimeFormat › DateTimeFormat
Intl.DateTimeFormat() constructor - JavaScript
let o = new Intl.DateTimeFormat("en" , { timeStyle: "short" }); console.log(o.format(Date.now())); // "13:31 AM" let o = new Intl.DateTimeFormat("en" , { dateStyle: "short" }); console.log(o.format(Date.now())); // "07/07/20" let o = new Intl.DateTimeFormat("en" , { timeStyle: "medium", dateStyle: "short" }); console.log(o.format(Date.now())); // "07/07/20, 13:31:55 AM"
🌐
Can I Use
caniuse.com
"datetimeformat" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
🌐
CodingNomads
codingnomads.com › formatting-dates-and-times-javascript-intl
Formatting Dates and Times in JavaScript Using Intl
That the Intl object is a tool for formatting dates, numbers, and lists, supporting many locales and options. To treat dates as UTC internally to maintain consistency and only convert to local times when necessary, although sometimes different ...