Languages and regions Recommended
Format dates and numbers for the reader
Format dates, numbers and money for the reader's locale with a formatting library. Show times with a named time zone.
How to do it
Format with an ICU-based library, such as Intl in JavaScript, Babel in Python, the intl extension in PHP or ICU4J in Java. Always pass a locale, and pass a time zone for dates and times.
Example
const when = new Date('2026-03-05T14:00:00Z');
new Intl.DateTimeFormat('sv-SE', { dateStyle: 'long', timeStyle: 'long', timeZone: 'Europe/Stockholm' }).format(when);
// "5 mars 2026 kl. 15:00:00 CET"
new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(1234.5);
// "1.234,50 €", with a no-break space before the €
# Python with Babel
from datetime import datetime, timezone
from zoneinfo import ZoneInfo
from babel.dates import format_datetime
from babel.numbers import format_currency
when = datetime(2026, 3, 5, 14, 0, tzinfo=timezone.utc)
format_datetime(when, "long", tzinfo=ZoneInfo("Europe/Stockholm"), locale="sv_SE")
# "5 mars 2026 15:00:00 CET"
format_currency(1234.5, "EUR", locale="de_DE") # "1.234,50 €"
// PHP with the intl extension
$when = new DateTimeImmutable('2026-03-05T14:00:00Z');
$dates = new IntlDateFormatter('sv_SE', IntlDateFormatter::LONG, IntlDateFormatter::LONG, 'Europe/Stockholm');
echo $dates->format($when); // "5 mars 2026 kl. 15:00:00 CET"
echo (new NumberFormatter('de_DE', NumberFormatter::CURRENCY))->formatCurrency(1234.5, 'EUR'); // "1.234,50 €"
How to check
A unit test formats a fixed date and amount for each supported locale. The output matches the expected strings.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/languages-and-regions/locale-content.