Use JavaScript’s built-in Intl.DateTimeFormat to format dates for a user’s locale, calendar, numbering system, and time zone. Pass a BCP 47 locale such as en-GB and set the options your application needs; avoid building localized strings by joining date fields with hard-coded punctuation.
Start with a locale-aware formatter
A locale affects conventions such as language and field order: for example, U.S. and U.K. English commonly display dates in different orders. Give the formatter the interface locale, rather than assuming that every user expects month/day/year.
As an Amazon Associate I earn from qualifying purchases.
const instant = new Date("2026-10-04T12:00:00Z");
const formatter = new Intl.DateTimeFormat("fr-FR", {
dateStyle: "full",
calendar: "gregory",
timeZone: "Europe/Paris",
});
console.log(formatter.format(instant));
The result is a localized string for the requested settings. Exact punctuation, spacing, and other presentation details can differ between runtimes. MDN’s constructor reference documents the available locale and formatting options.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsChoose the calendar and numbering system
Calendar
A locale has a default calendar, but you can request another with the calendar option. Common values include gregory, persian, and chinese. You can also specify a calendar in the locale’s Unicode extension, such as ja-JP-u-ca-japanese. If both the locale extension and the calendar option specify a calendar, the option takes precedence.
#1 Best Overall
const formatter = new Intl.DateTimeFormat("en-US", {
dateStyle: "long",
calendar: "persian",
timeZone: "UTC",
});
Use an explicit calendar when the application requires one rather than relying on a locale default. Where supported, Intl.supportedValuesOf("calendar") can list calendar types available in the runtime.
Numbering system
To request a particular digit system, use numberingSystem or the locale’s nu Unicode extension. An explicit option takes precedence over the extension; otherwise, the locale determines the default.
const formatter = new Intl.DateTimeFormat("ar-EG", {
dateStyle: "long",
numberingSystem: "arab",
timeZone: "UTC",
});
Set the time zone deliberately
A JavaScript Date represents an instant. Formatting that instant in another time zone changes the displayed clock time and can change the displayed calendar day; it does not change the stored instant. If you omit timeZone, the runtime’s default time zone is used, so the same date can display differently on different devices.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- Use
"UTC"for output that must be stable across machines, such as reproducible logs or tests. - Use an IANA zone such as
"America/New_York"or"Europe/Paris"when the display should follow a particular region. - Omit the option only when the user’s runtime-local time zone is intentionally the desired behavior.
To include a zone name, request timeZoneName. The localized name may fall back to another form, so do not rely on one exact text label in every runtime. See MDN’s JavaScript internationalization guide for the distinction between an instant and its localized display.
Select a preset or specific fields
For common levels of detail, use dateStyle and timeStyle with "full", "long", "medium", or "short". The locale determines how those styles are presented.
const dateFormatter = new Intl.DateTimeFormat("en-GB", {
dateStyle: "medium",
timeZone: "UTC",
});
For precise control over displayed fields, request components such as weekday, year, month, day, hour, and minute instead:
const dateFormatter = new Intl.DateTimeFormat("en-GB", {
weekday: "long",
day: "numeric",
month: "long",
year: "numeric",
timeZone: "UTC",
});
Do not combine dateStyle or timeStyle with individual date or time component options in the same options object.
Build formatters consistently
If your application needs a predictable default time zone but permits a caller to override it, place defaults before the caller’s options:
function makeDateFormatter(locale, options = {}) {
return new Intl.DateTimeFormat(locale, {
dateStyle: "medium",
timeZone: "UTC",
...options,
});
}
const formatter = makeDateFormatter("en-GB", { calendar: "gregory" });
console.log(formatter.format(new Date("2026-10-04T12:00:00Z")));
Here, UTC is the default, while a supplied timeZone in options overrides it. If the product instead follows each user’s local zone, omit the default intentionally.
Rank #4
Use structured parts instead of parsing the string
format() returns a localized string, not a stable template with guaranteed separators. Do not split it on commas, slashes, or spaces to rearrange fields. Use formatToParts() when you need to wrap or style individual pieces while preserving locale-selected order and literals.
const formatter = new Intl.DateTimeFormat("en-GB", {
dateStyle: "long",
timeZone: "UTC",
});
const parts = formatter.formatToParts(new Date("2026-10-04T12:00:00Z"));
for (const part of parts) {
if (part.type === "day") {
console.log("Day:", part.value);
}
}
Parts have a type and a localized value; preserve the returned order and literals when reconstructing output. See MDN’s formatToParts() reference and its format() reference.
Recommended Free Tools
Check locale negotiation and runtime defaults
When locale support or defaults matter, inspect what the runtime will actually use rather than assuming it honored every preference.
Best Value
const requested = ["fr-FR", "fr"];
const supported = Intl.DateTimeFormat.supportedLocalesOf(requested);
const formatter = new Intl.DateTimeFormat(requested, {
dateStyle: "full",
timeZone: "UTC",
});
console.log(supported);
console.log(formatter.resolvedOptions());
supportedLocalesOf() reports requested locales supported without falling back to the runtime’s default locale. resolvedOptions() shows the formatter’s negotiated locale, calendar, numbering system, and time zone. References: supportedLocalesOf() and resolvedOptions().
MDN describes Intl.DateTimeFormat as broadly available across browsers since September 2017, but that baseline does not guarantee identical support for every newer option in every target runtime. Check compatibility for the specific features your application depends on. MDN’s API overview provides the general reference.
Keep date-only values distinct from instants
Because Date represents an instant rather than a date-only value, converting a timestamp for display in a different time zone can move it to the previous or next calendar day. Calendar selection also affects which calendar fields are presented. Decide what the underlying value means before formatting it: an event timestamp, a user-local appointment, and a date such as a birthday do not necessarily have the same time-zone requirements.
For Temporal inputs, additional rules apply: a Temporal.ZonedDateTime should use its own toLocaleString() or be converted appropriately, and non-ISO Temporal calendar values generally require a matching explicit calendar option.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




