JavaScript Intl.DateTimeFormat() Constructor

Beginner
6 min read
Updated: Nov 2026
3 examples
Constructor

Definition

new Intl.DateTimeFormat(locales, options) builds a formatter that turns a Date into a locale-aware string. Call format(date) for one string, or formatToParts(date) for labeled pieces.

Always pass a fixed Date and often timeZone: "UTC" in tutorials so the printed result does not depend on the machine clock or local zone.

Remember
new Intl.DateTimeFormat(locales, options)
fmt.format(date)
fmt.formatToParts(date)

timeZone: "UTC" → stable across machines
options: year, month, day, hour, minute...

Syntax

Create a formatter with a locale and options, then call format.

JavaScript
const d = new Date(Date.UTC(2024, 5, 15, 12, 0, 0));
const fmt = new Intl.DateTimeFormat("en-US", { timeZone: "UTC" });
console.log(fmt.format(d));
CallWhat it does
new Intl.DateTimeFormat("en-US", { timeZone: "UTC" })US English date style in UTC.
fmt.format(date)One formatted string for the date.
fmt.formatToParts(date)An array of { type, value } pieces.
{ hour: "2-digit", minute: "2-digit" }Control which time fields appear.

A standard JavaScript constructor on the Intl object: create one with new Intl.DateTimeFormat(). No import required. Siblings: Intl.getCanonicalLocales(), Intl.supportedValuesOf(), Intl.Collator(), Intl.DisplayNames(), Intl.DurationFormat(), Intl.ListFormat(), Intl.Locale(), Intl.NumberFormat(), Intl.PluralRules(), Intl.RelativeTimeFormat(), Intl.Segmenter().

Library declarations
JavaScript
// ECMAScript 2015 — Intl.DateTimeFormat
new Intl.DateTimeFormat(locales, options)
fmt.format(date)
fmt.formatToParts(date)

// options.timeZone, year, month, day, hour, minute, ...

Parameters

ParameterDescription
localesOptional. Locale string or list, such as "en-US" or "de-DE".
optionsOptional. Fields such as timeZone, year, month, day, hour, minute.
dateFor format / formatToParts: a Date (or timestamp).

Return Value

Return ValueDescription
DateTimeFormat objectFrom the constructor.
stringFrom format.
object[]From formatToParts: each part has type and value.

JavaScript Examples

Example 1 — Same Instant, Two Locales

Format one fixed UTC date in American and German styles.

JavaScript
const d = new Date(Date.UTC(2024, 5, 15, 12, 0, 0));
const opts = { timeZone: "UTC" };

console.log("en-US: " + new Intl.DateTimeFormat("en-US", opts).format(d));
console.log("de-DE: " + new Intl.DateTimeFormat("de-DE", opts).format(d));
Try It Yourself

How It Works

  1. Fixed instant. Month 5 means June because months are 0-based in the Date constructor.
  2. UTC zone. Both formatters use timeZone: "UTC" so the calendar day stays 15 June.
  3. Different order. US style is month/day/year; German style uses day.month.year.

Example 2 — Format Hours and Minutes

Ask only for a 24-hour clock time in UTC.

JavaScript
const d = new Date(Date.UTC(2024, 5, 15, 12, 0, 0));
const fmt = new Intl.DateTimeFormat("en-US", {
  timeZone: "UTC",
  hour: "2-digit",
  minute: "2-digit",
  hour12: false
});

console.log("Time: " + fmt.format(d));
Try It Yourself

How It Works

  1. Pick fields. Only hour and minute are requested, so no date appears.
  2. hour12: false. Forces a 24-hour clock for a stable 12:00.
  3. UTC again. Noon UTC stays noon no matter where you run the code.

Example 3 — Split a Date into Parts

Use formatToParts when you need each piece labeled, for example to style the month differently.

JavaScript
const d = new Date(Date.UTC(2024, 5, 15, 12, 0, 0));
const fmt = new Intl.DateTimeFormat("en-US", {
  timeZone: "UTC",
  year: "numeric",
  month: "long",
  day: "numeric"
});
const parts = fmt.formatToParts(d)
  .filter(function (p) { return p.type !== "literal"; })
  .map(function (p) { return p.type + ":" + p.value; });

console.log(parts.join("|"));
Try It Yourself

How It Works

  1. Parts array. Each item has a type such as month, day or year.
  2. Skip literals. Separators like commas are type literal; this example drops them.
  3. Join for display. Printing type:value pairs makes a clear, stable console line.

Browser & Runtime Support

Intl.DateTimeFormat is part of the original ES2015 Intl API (or arrived soon after and is now everywhere). Every current browser and Node.js has it.

✓ ES2015 · Widely supported

Intl.DateTimeFormat

Supported in Chrome 24+, Edge 12+, Firefox 29+, Safari 10+, Opera 15+ and Node.js 0.12+. Internet Explorer had partial Intl support only.

ES2015 Standard since
Google Chrome 24+ · Desktop & Mobile
Full support
Microsoft Edge 12+ · Chromium based
Full support
Mozilla Firefox 29+ · Desktop & Mobile
Full support
Apple Safari 10+ · macOS & iOS
Full support
Opera 15+ · Chromium based
Full support
Samsung Internet Recent versions · Android
Supported
Android WebView 24+ · Chromium based
Supported
Node.js 0.12+ · Server runtime
Supported
Deno Supported · JavaScript runtime
Supported
Bun Supported · JavaScript runtime
Supported
Internet Explorer No native support
Not supported
Intl.DateTimeFormat Excellent

Bottom line: Safe to use in every current browser and in Node.js. No feature-detect needed for modern code.

Frequently Asked Questions

It formats a Date into a locale-aware string, with options for which fields to show and which time zone to use.
So the printed calendar day and clock time stay the same on every machine, independent of the local zone.
It returns an array of pieces with type and value, so you can style or rearrange parts without parsing the finished string.
Yes. Date.UTC(2024, 5, 15) is 15 June 2024, because month 5 means June.
Yes. Pass an array of tags; the engine picks the best available locale from the list.

Next: Intl.DisplayNames

Learn how to turn language, region and currency codes into readable names.

Intl.DisplayNames 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.

14 people found this page helpful