Intl.NumberFormat.prototype.formatToParts()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2019.
The formatToParts()
method of Intl.NumberFormat
instances returns an array of objects representing each part of the formatted string that would be returned by format()
. It is useful for building custom strings from the locale-specific tokens.
Try it
const amount = 654321.987;
const options = { style: "currency", currency: "USD" };
const numberFormat = new Intl.NumberFormat("en-US", options);
const parts = numberFormat.formatToParts(amount);
const partValues = parts.map((p) => p.value);
console.log(partValues);
// Expected output: "["$", "654", ",", "321", ".", "99"]"
Syntax
formatToParts(number)
Parameters
number
-
A
Number
,BigInt
, or string, to format. Strings are parsed in the same way as in number conversion, except thatformatToParts()
will use the exact value that the string represents, avoiding loss of precision during implicitly conversion to a number.
Return value
An Array
of objects containing the formatted number in parts. Each object has two properties, type
and value
, each containing a string. The string concatenation of value
, in the order provided, will result in the same string as format()
. The type
may be one of the following:
literal
-
Any string that's a part of the format pattern; for example
" "
. Note that common tokens like the decimal separator or the plus/minus signs have their own token types. integer
-
The integral part of the number, or a segment of it if using grouping (controlled by
options.useGrouping
). group
-
The group separator string, such as
","
. Only present when using grouping (controlled byoptions.useGrouping
). decimal
-
The decimal separator string, such as
"."
. Only present whenfraction
is present. fraction
-
The fractional part of the number.
compact
-
The compact exponent, such as
"M"
or"thousands"
. Only present whenoptions.notation
is"compact"
. The form ("short"
or"long"
) can be controlled viaoptions.compactDisplay
. exponentSeparator
-
The exponent separator, such as
"E"
. Only present whenoptions.notation
is"scientific"
or"engineering"
. exponentMinusSign
-
The exponent minus sign string, such as
"-"
. Only present whenoptions.notation
is"scientific"
or"engineering"
and the exponent is negative. exponentInteger
-
The exponent's integer value. Only present when
options.notation
is"scientific"
or"engineering"
. nan
-
A string representing
NaN
, such as"NaN"
. This is the sole token representing the number itself when the number isNaN
. infinity
-
A string representing
Infinity
or-Infinity
, such as"∞"
. This is the sole token representing the number itself when the number isInfinity
or-Infinity
. plusSign
-
The plus sign, such as
"+"
. minusSign
-
The minus sign, such as
"-"
. percentSign
-
The percent sign, such as
"%"
. Only present whenoptions.style
is"percent"
. unit
-
The unit string, such as
"l"
or"litres"
. Only present whenoptions.style
is"unit"
. The form ("short"
,"narrow"
, or"long"
) can be controlled viaoptions.unitDisplay
. currency
-
The currency string, such as
"$"
,"€"
,"Dollar"
, or"Euro"
. Only present whenoptions.style
is"currency"
. The form ("code"
,"symbol"
,"narrowSymbol"
, or"name"
) can be controlled viaoptions.currencyDisplay
. unknown
-
Reserved for any token that's not recognized as one of the above; should be rarely encountered.
Examples
Using formatToParts()
The format()
method outputs localized, opaque strings that cannot be manipulated directly:
const number = 3500;
const formatter = new Intl.NumberFormat("de-DE", {
style: "currency",
currency: "EUR",
});
formatter.format(number);
// "3.500,00 €"
However, in many user interfaces you may want to customize the formatting of this string, or interleave it with other texts. The formatToParts()
method produces the same information in parts:
formatter.formatToParts(number);
// return value:
[
{ type: "integer", value: "3" },
{ type: "group", value: "." },
{ type: "integer", value: "500" },
{ type: "decimal", value: "," },
{ type: "fraction", value: "00" },
{ type: "literal", value: " " },
{ type: "currency", value: "€" },
];
Now the information is available separately and it can be formatted and concatenated again in a customized way. For example by using Array.prototype.map()
, arrow functions, a switch statement, template literals, and Array.prototype.join()
, to insert additional markup for certain components.
const numberString = formatter
.formatToParts(number)
.map(({ type, value }) => {
switch (type) {
case "currency":
return `<strong>${value}</strong>`;
default:
return value;
}
})
.join("");
console.log(numberString);
// "3.500,00 <strong>€</strong>"
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.numberformat.prototype.formattoparts |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/string/length/index.md

# Original Wiki contributors
buckcronk
sydh5524
mfuji09
pgmreddy
wbamberg
fscholz
Brettz9
tjcrowder
Robg1
fanerge
aetonsi
irenesmith
james-owen
rwaldron
PeterDavidCarter
Sheppy
roanongh
jameshkramer
arai
MichaelRushton
Mingun
teoli
ethertank
ziyunfei
jstrimpel
evilpie
Mgjbot
Maian
Nickolay
Dria


Intl.NumberFormat.prototype.formatRangeToParts()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2023.
The formatRangeToParts()
method of Intl.NumberFormat
instances returns an Array
of objects containing the locale-specific tokens from which it is possible to build custom strings while preserving the locale-specific parts. This makes it possible to provide locale-aware custom formatting ranges of number strings.
Syntax
formatRangeToParts(startRange, endRange)
Parameters
startRange
-
A
Number
,BigInt
, or string, to format. Strings are parsed in the same way as in number conversion, except thatformatRangeToParts()
will use the exact value that the string represents, avoiding loss of precision during implicitly conversion to a number. endRange
Return value
An Array
of objects containing the formatted range in parts. Each object has three properties, type
, value
, and source
, each containing a string. The string concatenation of value
, in the order provided, will result in the same string as formatRange()
. The type
may have the same values as formatToParts()
, or the additional value "approximatelySign"
(see below). The source
can be one of the following:
startRange
-
The token is a part of the start number.
endRange
-
The token is a part of the end number.
-
The token is shared between the start and end; for example, the currency symbol. All literals that are part of the range pattern itself, such as the
"–"
separator, are also marked asshared
.
If the start and end numbers are formatted to the same string, then the output has the same list of tokens as calling formatToParts()
on the start number, with all tokens marked as source: "shared"
. In addition, the first token may be an "approximately equals" symbol (e.g., "~") with type: "approximatelySign"
. The insertion of this symbol only depends on the locale settings, and is inserted even when startRange === endRange
.
Exceptions
RangeError
-
Thrown if either
startRange
orendRange
isNaN
or an inconvertible string. TypeError
-
Thrown if either
startRange
orendRange
is undefined.
Examples
Using formatRangeToParts()
The formatRange()
method outputs localized, opaque strings that cannot be manipulated directly:
const startRange = 3500;
const endRange = 9500;
const formatter = new Intl.NumberFormat("de-DE", {
style: "currency",
currency: "EUR",
});
console.log(formatter.formatRange(startRange, endRange));
// "3.500,00–9.500,00 €"
However, in many user interfaces you may want to customize the formatting of this string, or interleave it with other texts. The formatRangeToParts()
method produces the same information in parts:
console.log(formatter.formatRangeToParts(startRange, endRange));
// return value:
[
{ type: "integer", value: "3", source: "startRange" },
{ type: "group", value: ".", source: "startRange" },
{ type: "integer", value: "500", source: "startRange" },
{ type: "decimal", value: ",", source: "startRange" },
{ type: "fraction", value: "00", source: "startRange" },
{ type: "literal", value: "–", source: "shared" },
{ type: "integer", value: "9", source: "endRange" },
{ type: "group", value: ".", source: "endRange" },
{ type: "integer", value: "500", source: "endRange" },
{ type: "decimal", value: ",", source: "endRange" },
{ type: "fraction", value: "00", source: "endRange" },
{ type: "literal", value: " ", source: "shared" },
{ type: "currency", value: "€", source: "shared" },
];
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.numberformat.prototype.formatrangetoparts |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/string/valueof/index.md

# Original Wiki contributors
fscholz
wbamberg
chrisdavidmills
jameshkramer
eduardoboucas
Mingun
Sheppy
evilpie
Mgjbot
Diablownik
Maian
Dria


Intl.NumberFormat.supportedLocalesOf()

Intl.NumberFormat.supportedLocalesOf()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
The Intl.NumberFormat.supportedLocalesOf()
static method returns an array containing those of the provided locales that are supported in number formatting without having to fall back to the runtime's default locale.
Try it
const locales = ["ban", "id-u-co-pinyin", "de-ID"];
const options = { localeMatcher: "lookup" };
console.log(Intl.NumberFormat.supportedLocalesOf(locales, options));
// Expected output: Array ["id-u-co-pinyin", "de-ID"]
// (Note: the exact output may be browser-dependent)
Syntax
Intl.NumberFormat.supportedLocalesOf(locales)
Intl.NumberFormat.supportedLocalesOf(locales, options)
Parameters
locales
-
A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the
locales
argument, see the parameter description on theIntl
main page. options
Optional-
An object that may have the following property:
localeMatcher
-
The locale matching algorithm to use. Possible values are
"lookup"
and"best fit"
; the default is"best fit"
. For information about this option, see the Intl page.
Return value
An array of strings representing a subset of the given locale tags that are supported in number formatting without having to fall back to the runtime's default locale.
Examples
Using supportedLocalesOf()
Assuming a runtime that supports Indonesian and German but not Balinese in number formatting, supportedLocalesOf
returns the Indonesian and German language tags unchanged, even though pinyin
collation is neither relevant to number formatting nor used with Indonesian, and a specialized German for Indonesia is unlikely to be supported. Note the specification of the "lookup"
algorithm here — a "best fit"
matcher might decide that Indonesian is an adequate match for Balinese since most Balinese speakers also understand Indonesian, and therefore return the Balinese language tag as well.
const locales = ["ban", "id-u-co-pinyin", "de-ID"];
const options = { localeMatcher: "lookup" };
console.log(Intl.NumberFormat.supportedLocalesOf(locales, options));
// ["id-u-co-pinyin", "de-ID"]
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.numberformat.supportedlocalesof |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/numberformat/numberformat/index.md

# Original Wiki contributors
romulocintra
mfuji09
fscholz
acontreras89
wbamberg


Intl.NumberFormat.prototype.formatRange()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2023.
The formatRange()
method of Intl.NumberFormat
instances formats a range of numbers according to the locale and formatting options of this Intl.NumberFormat
object.
Syntax
formatRange(startRange, endRange)
Parameters
startRange
-
A
Number
,BigInt
, or string, to format. Strings are parsed in the same way as in number conversion, except thatformatRange()
will use the exact value that the string represents, avoiding loss of precision during implicitly conversion to a number. endRange
Return value
A string representing the given range of numbers formatted according to the locale and formatting options of this Intl.NumberFormat
object. If the start and end values are formatted to the same string, the output will only contain a single value, possibly prefixed with an "approximately equals" symbol (e.g., "~$3"). The insertion of this symbol only depends on the locale settings, and is inserted even when startRange === endRange
.
Exceptions
RangeError
-
Thrown if either
startRange
orendRange
isNaN
or an inconvertible string. TypeError
-
Thrown if either
startRange
orendRange
is undefined.
Description
The formatRange
getter function formats a range of numbers into a string according to the locale and formatting options of this Intl.NumberFormat
object from which it is called.
Examples
Using formatRange
Use the formatRange
getter function for formatting a range of currency values:
const nf = new Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
maximumFractionDigits: 0,
});
console.log(nf.formatRange(3, 5)); // "$3 – $5"
// Note: the "approximately equals" symbol is added if
// startRange and endRange round to the same values.
console.log(nf.formatRange(2.9, 3.1)); // "~$3"
const nf = new Intl.NumberFormat("es-ES", {
style: "currency",
currency: "EUR",
maximumFractionDigits: 0,
});
console.log(nf.formatRange(3, 5)); // "3-5 €"
console.log(nf.formatRange(2.9, 3.1)); // "~3 €"
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.numberformat.prototype.formatrange |


Intl.NumberFormat.prototype.resolvedOptions()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
The resolvedOptions()
method of Intl.NumberFormat
instances returns a new object with properties reflecting the options computed during initialization of this NumberFormat
object.
Try it
const numberFormat = new Intl.NumberFormat("de-DE");
const options = numberFormat.resolvedOptions();
console.log(options.locale);
// Expected output: "de-DE"
console.log(options.numberingSystem);
// Expected output: "latn"
console.log(options.style);
// Expected output: "decimal"
Syntax
resolvedOptions()
Parameters
None.
Return value
A new object with properties reflecting the options computed during the initialization of this NumberFormat
object. The object has the following properties, in the order they are listed:
locale
-
The BCP 47 language tag for the locale actually used, determined by the locale negotiation process. Only the
nu
Unicode extension key, if requested, may be included in the output. numberingSystem
-
The value provided for this property in the
options
argument, or using the Unicode extension key"nu"
, with default filled in as needed. It is a supported numbering system for this locale. The default is locale dependent. style
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"decimal"
,"percent"
,"currency"
, or"unit"
. The default is"decimal"
. currency
Optional-
The value provided for this property in the
options
argument. It is only present ifstyle
is"currency"
. It is an ISO 4217 currency code; seeIntl.supportedValuesOf()
. It is required ifstyle
is"currency"
so there is no default. currencyDisplay
Optional-
The value provided for this property in the
options
argument, with default filled in as needed. It is only present ifstyle
is"currency"
. It is either"code"
,"symbol"
,"narrowSymbol"
, or"name"
. The default is"symbol"
. currencySign
Optional-
The value provided for this property in the
options
argument, with default filled in as needed. It is only present ifstyle
is"currency"
. It is either"standard"
or"accounting"
. The default is"standard"
. unit
Optional-
The value provided for this property in the
options
argument. It is only present ifstyle
is"unit"
. It is a sanctioned unit identifier from the full CLDR list. It is required ifstyle
is"unit"
so there is no default. unitDisplay
Optional-
The value provided for this property in the
options
argument, with default filled in as needed. It is only present ifstyle
is"unit"
. It is either"short"
,"narrow"
, or"long"
. The default is"short"
. minimumIntegerDigits
-
The value provided for this property in the
options
argument, with default filled in as needed. It is an integer between1
and21
. The default is1
. minimumFractionDigits
,maximumFractionDigits
Optional-
The value provided for these properties in the
options
argument, with defaults filled in as needed. They are only present if necessary; see digit options. It is an integer between0
and100
. minimumSignificantDigits
,maximumSignificantDigits
Optional-
The value provided for these properties in the
options
argument, with defaults filled in as needed. They are only present if necessary; see digit options. It is an integer between1
and21
. useGrouping
-
The value provided for this property in the
options
argument, with default filled in as needed, and with some values normalized. It is either"always"
,"auto"
,"min2"
, or the booleanfalse
. The default is"min2"
ifnotation
is"compact"
, and"auto"
otherwise. notation
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"standard"
,"scientific"
,"engineering"
, or"compact"
. The default is"standard"
. compactDisplay
Optional-
The value provided for this property in the
options
argument, with default filled in as needed. It is only present ifnotation
is"compact"
. It is either"short"
or"long"
. The default is"short"
. signDisplay
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"auto"
,"always"
,"exceptZero"
,"negative"
, or"never"
. The default is"auto"
. roundingIncrement
-
The value provided for this property in the
options
argument, with default filled in as needed. It is one of1
,2
,5
,10
,20
,25
,50
,100
,200
,250
,500
,1000
,2000
,2500
, and5000
. The default is1
. roundingMode
-
The value provided for this property in the
options
argument, with default filled in as needed. It is one of"ceil"
,"floor"
,"expand"
,"trunc"
,"halfCeil"
,"halfFloor"
,"halfExpand"
,"halfTrunc"
, and"halfEven"
. The default is"halfExpand"
. roundingPriority
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"auto"
,"morePrecision"
, or"lessPrecision"
. The default is"auto"
. trailingZeroDisplay
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"auto"
or"stripIfInteger"
. The default is"auto"
.
Examples
Using the resolvedOptions
method
// Create a NumberFormat
const de = new Intl.NumberFormat("de-DE", {
style: "currency",
currency: "USD",
maximumFractionDigits: 2,
roundingIncrement: 5,
roundingMode: "halfCeil",
});
// Resolve the options
const usedOptions = de.resolvedOptions();
console.log(usedOptions.locale); // "de-DE"
console.log(usedOptions.numberingSystem); // "latn"
console.log(usedOptions.compactDisplay); // undefined ("notation" not set to "compact")
console.log(usedOptions.currency); // "USD"
console.log(usedOptions.currencyDisplay); // "symbol"
console.log(usedOptions.currencySign); // "standard"
console.log(usedOptions.minimumIntegerDigits); // 1
console.log(usedOptions.minimumFractionDigits); // 2
console.log(usedOptions.maximumFractionDigits); // 2
console.log(usedOptions.minimumSignificantDigits); // undefined (maximumFractionDigits is set)
console.log(usedOptions.maximumSignificantDigits); // undefined (maximumFractionDigits is set)
console.log(usedOptions.notation); // "standard"
console.log(usedOptions.roundingIncrement); // 5
console.log(usedOptions.roundingMode); // halfCeil
console.log(usedOptions.roundingPriority); // auto
console.log(usedOptions.signDisplay); // "auto"
console.log(usedOptions.style); // "currency"
console.log(usedOptions.trailingZeroDisplay); // auto
console.log(usedOptions.useGrouping); // auto
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.numberformat.prototype.resolvedoptions |


Intl.supportedValuesOf()

Intl.supportedValuesOf()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2022.
The Intl.supportedValuesOf()
static method returns an array containing the supported calendar, collation, currency, numbering systems, or unit values supported by the implementation.
Duplicates are omitted and the array is sorted in ascending lexicographical order (or more precisely, using Array.prototype.sort()
with an undefined
compare function).
The method can be used to feature-test whether values are supported in a particular implementation and download a polyfill only if necessary. It can also be used to build UIs that allow users to select their preferred localized values, for example when the UI is created from WebGL or server-side.
This method is locale-unaware: it is possible that certain identifiers are only supported or preferred in certain locales. If you want to determine the preferred values for a specific locale, you should use the Intl.Locale
object, such as Intl.Locale.prototype.getCalendars()
.
Try it
console.log(Intl.supportedValuesOf("calendar"));
console.log(Intl.supportedValuesOf("collation"));
console.log(Intl.supportedValuesOf("currency"));
console.log(Intl.supportedValuesOf("numberingSystem"));
console.log(Intl.supportedValuesOf("timeZone"));
console.log(Intl.supportedValuesOf("unit"));
// Expected output: Array ['key'] (for each key)
try {
Intl.supportedValuesOf("someInvalidKey");
} catch (err) {
console.log(err.toString());
// Expected output: RangeError: invalid key: "someInvalidKey"
}
Syntax
Intl.supportedValuesOf(key)
Parameters
key
-
A key string indicating the category of values to be returned. This is one of:
"calendar"
: see supported calendar types"collation"
: see supported collation types"currency"
: see supported currency identifiers"numberingSystem"
: see supported numbering system types"timeZone"
: see supported time zone identifiers"unit"
: see supported unit identifiers
Return value
A sorted array of unique string values indicating the values supported by the implementation for the given key. The values that could be returned are listed below.
Supported calendar types
Below are all values that are commonly supported by browsers for the calendar
key. These values can be used for the calendar
option or the ca
Unicode extension key when creating objects such as Intl.DateTimeFormat
, as well as for creating Temporal
date objects. This list is explicitly sanctioned by the ECMA-402 specification, so all implementations should be consistent.
| Value | Description |
|---|---|
buddhist |
Thai Buddhist calendar, proleptic. Month numbers, month codes, and days are the same as in the ISO 8601 calendar, but the epoch year is different. There is one era. |
chinese |
Traditional Chinese calendar, proleptic. Lunisolar calendar used in China based on data published by the Purple Mountain Observatory between 1900 and 2100 (which compiles with GB/T 33661-2017 between 1912 and 2100), falling back to an implementation-defined approximation outside that range. The arithmetic year is identical to gregory , and there are no eras. |
coptic |
Coptic calendar, proleptic. Similar solar algorithm to ethioaa and ethiopic , with one era and a different epoch year. |
dangi |
Traditional Korean calendar, proleptic. Lunisolar calendar using months published by the Korea Astronomy and Space Science Institute (KASI) between 1900 and 2050, falling back to an implementation-defined approximation outside that range. The arithmetic year is identical to gregory , and there are no eras. |
ethioaa |
Ethiopic calendar, Amete Alem, proleptic. Similar solar algorithm to coptic and ethiopic , with one era and a different epoch year. |
ethiopic |
Ethiopic calendar, Amete Mihret, proleptic. Similar solar algorithm to coptic and ethioaa , with two eras and a different epoch year. |
gregory |
Gregorian calendar, proleptic. Solar calendar almost identical to the ISO 8601 calendar, except that it does not define week numbering and it contains two eras, one before the epoch year. |
hebrew |
Hebrew calendar, proleptic. Civil calendar with Tishrei as the first month of the year. Lunisolar calendar with one leap month inserted after month 5. There is one era. |
indian |
Indian national (or Śaka) calendar, proleptic. Solar calendar with one era. |
islamic-civil |
Hijri calendar, proleptic, tabular/rule-based with leap year rule II (leap years 2,5,7,10,13,16,18,21,24,26,29 in the 30-year cycle (1-based numbering)) and civil epoch (Friday July 16, 622 Julian / 0622-07-19 ISO) |
islamic-tbla |
Hijri calendar, proleptic, tabular/rule-based with leap year rule II (leap years 2,5,7,10,13,16,18,21,24,26,29 in the 30-year cycle (1-based numbering)) and astronomical epoch (Thursday July 15, 622 Julian / 0622-07-18 ISO) |
islamic-umalqura |
Hijri calendar, proleptic, Umm al-Qura. Lunar calendar using KACST-calculated months from the start of 1300 AH (1882-11-12 ISO) to the end of 1600 AH (2174-11-25 ISO), falling back to islamic-civil outside that range. |
iso8601 |
ISO calendar (variant of the Gregorian calendar with week rules and formatting parameters made region-independent) |
japanese |
Japanese Imperial calendar (this calendar adds an era for each new emperor, so the output year and era for a future date may not match the input year and era when your code runs on a future engine version. Note: See the remarks below this table about dates prior to 1868-10-23 ISO.) |
persian |
Persian (or Solar Hijri) calendar, proleptic. There is one era. |
roc |
Republic of China (or Minguo) calendar, proleptic. Month numbers, month codes, and days are the same as in the ISO 8601 calendar, but the epoch year is different. There are two eras, one before the epoch year and one after. |
As of October 2025, in the japanese
calendar, dates prior to 1868-10-23 ISO (the start date of the year 1 Meiji) don't work as expected in browsers in two ways. First, CLDR had the wrong start date for the Meiji era, which causes calendar implementations to extend the Meiji era further to the past than it actually did. Second, the upcoming Intl era and monthCode Proposal specifies that dates prior to 1873-01-01 ISO should use Gregorian eras, but browsers have traditionally used approximations of prior Japanese eras instead. The japanese
calendar was taken into use on January 1, 6 Meiji / 1873-01-01 ISO, so these problems only affect proleptic dates.
The types below are specified in CLDR but do not have implementations distinct from the above calendars in browsers.
| Value | Description | Notes |
|---|---|---|
ethiopic-amete-alem |
Ethiopic calendar, Amete Alem, proleptic. | This is an alias for ethioaa and therefore is not returned by supportedValuesOf() . Use ethioaa instead. |
islamic |
Hijri calendar, unspecified algorithm. | As of April 2025, this is an astronomical simulation whose parameters are undocumented and that is not known to match a specific Hijri calendar variant from non-software contexts. It is specified to be canonicalized to a different calendar, usually one of islamic-umalqura , islamic-tbla , or islamic-civil , and raise a warning. |
islamicc
Deprecated
|
Civil (algorithmic) Arabic calendar. | This is an alias for islamic-civil and therefore is not returned by supportedValuesOf() . Use islamic-civil instead. |
The Temporal.PlainDate.prototype.era
and Temporal.PlainDate.prototype.monthCode
docs provide more information about different calendars.
References:
- CLDR Calendar type keys
- UTS 35, Dates
- Islamic calendar types (CLDR design proposal)
Supported collation types
Below are all values that are commonly supported by browsers for the collation
key. These values can be used for the collation
option or the co
Unicode extension key when creating objects such as Intl.Collator
.
| Value | Description |
|---|---|
compat |
A previous version of the ordering, for compatibility (for Arabic) |
dict |
Dictionary style ordering (such as in Sinhala). Also recognized as dictionary . |
emoji |
Recommended ordering for emoji characters |
eor |
European ordering rules |
phonebk |
Phonebook style ordering (such as in German). Also recognized as phonebook . |
phonetic |
Phonetic ordering (sorting based on pronunciation; for Lingala) |
pinyin |
Pinyin ordering for Latin and for CJK characters (used in Chinese) |
searchjl |
Special collation type for Korean initial consonant search. Warning: This collation is not for sorting, even though you can only use it with Intl.Collator of usage: "sort" . |
stroke |
Pinyin ordering for Latin, stroke order for CJK characters (used in Chinese) |
trad |
Traditional style ordering (such as in Spanish). Also recognized as traditional . |
unihan |
Pinyin ordering for Latin, Unihan radical-stroke ordering for CJK characters (used in Chinese) |
zhuyin |
Pinyin ordering for Latin, zhuyin order for Bopomofo and CJK characters (used in Chinese) |
The types below are specified in CLDR data, but are deprecated, are discouraged from explicit usage, and/or may not be indicated by browsers as supported for various reasons. Avoid using them:
| Value | Description | Notes |
|---|---|---|
big5han
Deprecated
|
Pinyin ordering for Latin, big5 charset ordering for CJK characters (used in Chinese) | Deprecated. |
direct
Deprecated
|
Binary code point order (used in Hindi) | Deprecated. |
ducet |
The default Unicode collation element table order | The ducet collation type is not available to the Web. |
gb2312
Deprecated
|
Pinyin ordering for Latin, gb2312han charset ordering for CJK characters (for Chinese). Also recognized as gb2312han . |
Deprecated. |
reformed
Deprecated
|
Reformed ordering (such as Swedish) | Deprecated. This is the old name for the default ordering for Swedish whose collation naming used to differ from other languages. Since this was the default, request sv instead of requesting sv-u-co-reformed . |
search |
Special collation type for string search | Do not use as a collation type, since in Intl.Collator , this collation is activated via the usage: "search" option. There is currently no API for substring search, so this is currently only good for filtering a list of strings by trying a full-string match of the key against each list item. |
standard |
Default ordering for each language, except Chinese (and, previously, Swedish) | Do not use explicitly. In general, it's unnecessary to specify this explicitly and specifying this for Swedish is problematic due to the different meaning for Swedish in the past. |
References:
Supported currency identifiers
Currency identifiers are three-letter uppercase codes defined in ISO 4217. These values can be used for the currency
option when creating objects such as Intl.NumberFormat
, as well as for Intl.DisplayNames.prototype.of()
. There are over 300 identifiers in common use so we won't list them. For an exhaustive list of possible identifiers, see the Wikipedia article.
References:
Supported numbering system types
Below are all values that are commonly supported by browsers for the numberingSystem
key. These values can be used for the numberingSystem
option or the nu
Unicode extension key when creating objects such as Intl.NumberFormat
. For the rows with "digit characters", the runtime translates the digits one-by-one without extra actions. The others marked as "algorithmic" need additional algorithms to translate the digits. The higher the Unicode code point is, the newer the numbering system is and the more likely it is unsupported by all browsers.
| Value | Description | Digit characters |
|---|---|---|
adlm |
Adlam digits | 𞥐𞥑𞥒𞥓𞥔𞥕𞥖𞥗𞥘𞥙 (U+1E950 to U+1E959) |
ahom |
Ahom digits | 𑜰𑜱𑜲𑜳𑜴𑜵𑜶𑜷𑜸𑜹 (U+11730 to U+11739) |
arab |
Arabic-Indic digits | ٠١٢٣٤٥٦٧٨٩ (U+0660 to U+0669) |
arabext |
Extended Arabic-Indic digits | ۰۰۱۲۳۴۵۶۷۸۹ (U+06F0 to U+06F9) |
armn |
Armenian upper case numerals | algorithmic |
armnlow |
Armenian lower case numerals | algorithmic |
bali |
Balinese digits | ᭐᭑᭒᭓᭔᭕᭖᭗᭘᭙ (U+1B50 to U+1B59) |
beng |
Bengali digits | ০১২৩৪৫৬৭৮৯ (U+09E6 to U+09EF) |
bhks |
Bhaiksuki digits | 𑱐𑱑𑱒𑱓𑱔𑱕𑱖𑱗𑱘𑱙 (U+11C50 to U+11C59) |
brah |
Brahmi digits | 𑁦𑁧𑁨𑁩𑁪𑁫𑁬𑁭𑁮𑁯 (U+11066 to U+1106F) |
cakm |
Chakma digits | 𑄶𑄷𑄸𑄹𑄺𑄻𑄼𑄽𑄾𑄿 (U+11136 to U+1113F) |
cham |
Cham digits | ꩐꩑꩒꩓꩔꩕꩖꩗꩘꩙ (U+AA50 to U+AA59) |
cyrl |
Cyrillic numerals | algorithmic |
deva |
Devanagari digits | ०१२३४५६७८९ (U+0966 to U+096F) |
diak |
Dives Akuru digits | 𑥐𑥑𑥒𑥓𑥔𑥕𑥖𑥗𑥘𑥙 (U+11950 to U+11959) |
ethi |
Ethiopic numerals | algorithmic |
fullwide |
Full width digits | ０１２３４５６７８９ (U+FF10 to U+FF19) |
gara |
Garay digits | (U+10D40 to U+10D49) |
geor |
Georgian numerals | algorithmic |
gong |
Gunjala Gondi digits | 𑶠𑶡𑶢𑶣𑶤𑶥𑶦𑶧𑶨𑶩 (U+11DA0 to U+11DA9) |
gonm |
Masaram Gondi digits | 𑵐𑵑𑵒𑵓𑵔𑵕𑵖𑵗𑵘𑵙 (U+11D50 to U+11D59) |
grek |
Greek upper case numerals | algorithmic |
greklow |
Greek lower case numerals | algorithmic |
gujr |
Gujarati digits | ૦૧૨૩૪૫૬૭૮૯ (U+0AE6 to U+0AEF) |
gukh |
Gurung Khema digits | (U+16130 to U+16139) |
guru |
Gurmukhi digits | ੦੧੨੩੪੫੬੭੮੯ (U+0A66 to U+0A6F) |
hanidays |
Han-character day-of-month numbering for lunar/other traditional calendars | |
hanidec |
Positional decimal system using Chinese number ideographs as digits | 〇一二三四五六七八九 (U+3007, U+4E00, U+4E8C, U+4E09, U+56DB, U+4E94, U+516D, U+4E03, U+516B, U+4E5D) |
hans |
Simplified Chinese numerals | algorithmic |
hansfin |
Simplified Chinese financial numerals | algorithmic |
hant |
Traditional Chinese numerals | algorithmic |
hantfin |
Traditional Chinese financial numerals | algorithmic |
hebr |
Hebrew numerals | algorithmic |
hmng |
Pahawh Hmong digits | 𖭐𖭑𖭒𖭓𖭔𖭕𖭖𖭗𖭘𖭙 (U+16B50 to U+16B59) |
hmnp |
Nyiakeng Puachue Hmong digits | 𞅀𞅁𞅂𞅃𞅄𞅅𞅆𞅇𞅈𞅉 (U+1E140 to U+1E149) |
java |
Javanese digits | ꧐꧑꧒꧓꧔꧕꧖꧗꧘꧙ (U+A9D0 to U+A9D9) |
jpan |
Japanese numerals | algorithmic |
jpanfin |
Japanese financial numerals | algorithmic |
jpanyear |
Japanese first-year Gannen numbering for Japanese calendar | algorithmic |
kali |
Kayah Li digits | ꤀꤁꤂꤃꤄꤅꤆꤇꤈꤉ (U+A900 to U+A909) |
kawi |
Kawi digits | 𑽐𑽑𑽒𑽓𑽔𑽕𑽖𑽗𑽘𑽙 (U+11F50 to U+11F59) |
khmr |
Khmer digits | ០១២៣៤៥៦៧៨៩ (U+17E0 to U+17E9) |
knda |
Kannada digits | ೦೧೨೩೪೫೬೭೮೯ (U+0CE6 to U+0CEF) |
krai |
Kirat Rai digits | (U+16D70 to U+16D79) |
lana |
Tai Tham Hora (secular) digits | ᪀᪁᪂᪃᪄᪅᪆᪇᪈᪉ (U+1A80 to U+1A89) |
lanatham |
Tai Tham (ecclesiastical) digits | ᪐᪑᪒᪓᪔᪕᪖᪗᪘᪙ (U+1A90 to U+1A99) |
laoo |
Lao digits | ໐໑໒໓໔໕໖໗໘໙ (U+0ED0 to U+0ED9) |
latn |
Latin digits | 0123456789 (U+0030 to U+0039) |
lepc |
Lepcha digits | ᱀᱁᱂᱃᱄᱅᱆᱇᱈᱉ (U+1C40 to U+1C49) |
limb |
Limbu digits | ᥆᥇᥈᥉᥊᥋᥌᥍᥎᥏ (U+1946 to U+194F) |
mathbold |
Mathematical bold digits | 𝟎𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗 (U+1D7CE to U+1D7D7) |
mathdbl |
Mathematical double-struck digits | 𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡 (U+1D7D8 to U+1D7E1) |
mathmono |
Mathematical monospace digits | 𝟶𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿 (U+1D7F6 to U+1D7FF) |
mathsanb |
Mathematical sans-serif bold digits | 𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵 (U+1D7EC to U+1D7F5) |
mathsans |
Mathematical sans-serif digits | 𝟢𝟣𝟤𝟥𝟦𝟧𝟨𝟩𝟪𝟫 (U+1D7E2 to U+1D7EB) |
mlym |
Malayalam digits | ൦൧൨൩൪൫൬൭൮൯ (U+0D66 to U+0D6F) |
modi |
Modi digits | 𑙐𑙑𑙒𑙓𑙔𑙕𑙖𑙗𑙘𑙙 (U+11650 to U+11659) |
mong |
Mongolian digits | ᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙ (U+1810 to U+1819) |
mroo |
Mro digits | 𖩠𖩡𖩢𖩣𖩤𖩥𖩦𖩧𖩨𖩩 (U+16A60 to U+16A69) |
mtei |
Meetei Mayek digits | ꯰꯱꯲꯳꯴꯵꯶꯷꯸꯹ (U+ABF0 to U+ABF9) |
mymr |
Myanmar digits | ၀၁၂၃၄၅၆၇၈၉ (U+1040 to U+1049) |
mymrepka |
Myanmar Eastern Pwo Karen digits | (U+116DA to U+116E3) |
mymrpao |
Myanmar Pao digits | (U+116D0 to U+116D9) |
mymrshan |
Myanmar Shan digits | ႐႑႒႓႔႕႖႗႘႙ (U+1090 to U+1099) |
mymrtlng |
Myanmar Tai Laing digits | ꧰꧱꧲꧳꧴꧵꧶꧷꧸꧹ (U+A9F0 to U+A9F9) |
nagm |
Nag Mundari digits | 𞓰𞓱𞓲𞓳𞓴𞓵𞓶𞓷𞓸𞓹 (U+1E4F0 to U+1E4F9) |
newa |
Newa digits | 𑑐𑑑𑑒𑑓𑑔𑑕𑑖𑑗𑑘𑑙 (U+11450 to U+11459) |
nkoo |
N'Ko digits | ߀߁߂߃߄߅߆߇߈߉ (U+07C0 to U+07C9) |
olck |
Ol Chiki digits | ᱐᱑᱒᱓᱔᱕᱖᱗᱘᱙ (U+1C50 to U+1C59) |
onao |
Ol Onal digits | (U+1E5F1 to U+1E5FA) |
orya |
Oriya digits | ୦୧୨୩୪୫୬୭୮୯ (U+0B66 to U+0B6F) |
osma |
Osmanya digits | 𐒠𐒡𐒢𐒣𐒤𐒥𐒦𐒧𐒨𐒩 (U+104A0 to U+104A9) |
outlined |
Legacy computing outlined digits | (U+1CCF0 to U+1CCF9) |
rohg |
Hanifi Rohingya digits | 𐴰𐴱𐴲𐴳𐴴𐴵𐴶𐴷𐴸𐴹 (U+10D30 to U+10D39) |
roman |
Roman upper case numerals | algorithmic |
romanlow |
Roman lowercase numerals | algorithmic |
saur |
Saurashtra digits | ꣐꣑꣒꣓꣔꣕꣖꣗꣘꣙ (U+A8D0 to U+A8D9) |
segment |
Legacy computing segmented digits | 🯰🯱🯲🯳🯴🯵🯶🯷🯸🯹 (U+1FBF0 to U+1FBF9) |
shrd |
Sharada digits | 𑇐𑇑𑇒𑇓𑇔𑇕𑇖𑇗𑇘𑇙 (U+111D0 to U+111D9) |
sind |
Khudawadi digits | 𑋰𑋱𑋲𑋳𑋴𑋵𑋶𑋷𑋸𑋹 (U+112F0 to U+112F9) |
sinh |
Sinhala Lith digits | ෦෧෨෩෪෫෬෭෮෯ (U+0DE6 to U+0DEF) |
sora |
Sora_Sompeng digits | 𑃰𑃱𑃲𑃳𑃴𑃵𑃶𑃷𑃸𑃹 (U+110F0 to U+110F9) |
sund |
Sundanese digits | ᮰᮱᮲᮳᮴᮵᮶᮷᮸᮹ (U+1BB0 to U+1BB9) |
sunu |
Sunuwar digits | (U+11BF0 to U+11BF9) |
takr |
Takri digits | 𑛀𑛁𑛂𑛃𑛄𑛅𑛆𑛇𑛈𑛉 (U+116C0 to U+116C9) |
talu |
New Tai Lue digits | ᧐᧑᧒᧓᧔᧕᧖᧗᧘᧙ (U+19D0 to U+19D9) |
taml |
Tamil numerals | algorithmic |
tamldec |
Modern Tamil decimal digits | ௦௧௨௩௪௫௬௭௮௯ (U+0BE6 to U+0BEF) |
telu |
Telugu digits | ౦౧౨౩౪౫౬౭౮౯ (U+0C66 to U+0C6F) |
thai |
Thai digits | ๐๑๒๓๔๕๖๗๘๙ (U+0E50 to U+0E59) |
tibt |
Tibetan digits | ༠༡༢༣༤༥༦༧༨༩ (U+0F20 to U+0F29) |
tirh |
Tirhuta digits | 𑓐𑓑𑓒𑓓𑓔𑓕𑓖𑓗𑓘𑓙 (U+114D0 to U+114D9) |
tnsa |
Tangsa digits | 𖫀𖫁𖫂𖫃𖫄𖫅𖫆𖫇𖫈𖫉 (U+16AC0 to U+16AC9) |
vaii |
Vai digits | ꘠꘡꘢꘣꘤꘥꘦꘧꘨꘩ (U+A620 to U+A629) |
wara |
Warang Citi digits | 𑣠𑣡𑣢𑣣𑣤𑣥𑣦𑣧𑣨𑣩 (U+118E0 to U+118E9) |
wcho |
Wancho digits | 𞋰𞋱𞋲𞋳𞋴𞋵𞋶𞋷𞋸𞋹 (U+1E2F0 to U+1E2F9) |
There are three special values: native
, traditio
, and finance
, whose meanings are locale-dependent, and will be resolved to the right system depending on the locale. Therefore, the resolvedOptions()
methods will never return these values, but Intl.Locale.prototype.numberingSystem
will (if provided as input).
References:
Supported time zone identifiers
Supported time zone identifiers can be used for the timeZone
option when creating objects such as Intl.DateTimeFormat
, as well as for creating Temporal
date objects. There are over 400 identifiers in common use so we won't list them. For an exhaustive list of possible identifiers, see the Wikipedia article or the IANA time zone database.
As you browse the list, note that the standardization of Temporal
requires browsers to always return the primary identifier in the IANA database, which may change over time. See time zones and offsets for more information. For example, the returned array should contain "Asia/Kolkata"
instead of "Asia/Calcutta"
because the latter is an alias of the former and they both correspond to India; however, it should contain both "Africa/Abidjan"
and "Atlantic/Reykjavik"
because they are in different countries, despite the latter also being an alias of the former.
References:
Supported unit identifiers
Below are all values that are commonly supported by browsers for the unit
key. These values can be used for the unit
option when creating objects such as Intl.NumberFormat
. This list is a subset of the CLDR explicitly sanctioned by the ECMA-402 specification, so all implementations should be consistent.
acre
bit
byte
celsius
centimeter
day
degree
fahrenheit
fluid-ounce
foot
gallon
gigabit
gigabyte
gram
hectare
hour
inch
kilobit
kilobyte
kilogram
kilometer
liter
megabit
megabyte
meter
microsecond
mile
mile-scandinavian
milliliter
millimeter
millisecond
minute
month
nanosecond
ounce
percent
petabyte
pound
second
stone
terabit
terabyte
week
yard
year
When specifying units, you can also combine two units with the "-per-" separator. For example, meter-per-second
or liter-per-megabyte
.
References:
Exceptions
RangeError
-
Thrown if an unsupported key was passed as a parameter.
Examples
Feature testing
You can check that the method is supported by comparing to undefined
:
if (typeof Intl.supportedValuesOf !== "undefined") {
// method is supported
}
Get all values for key
To get the supported values for calendar you call the method with the key "calendar"
.
You can then iterate through the returned array as shown below:
Intl.supportedValuesOf("calendar").forEach((calendar) => {
// "buddhist", "chinese", "coptic", "dangi", etc.
});
The other values are all obtained in the same way:
Intl.supportedValuesOf("collation").forEach((collation) => {
// "compat", "dict", "emoji", etc.
});
Intl.supportedValuesOf("currency").forEach((currency) => {
// "ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", etc.
});
Intl.supportedValuesOf("numberingSystem").forEach((numberingSystem) => {
// "adlm", "ahom", "arab", "arabext", "bali", etc.
});
Intl.supportedValuesOf("timeZone").forEach((timeZone) => {
// "Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", etc.
});
Intl.supportedValuesOf("unit").forEach((unit) => {
// "acre", "bit", "byte", "celsius", "centimeter", etc.
});
Invalid key throws RangeError
try {
Intl.supportedValuesOf("someInvalidKey");
} catch (err) {
// RangeError: invalid key: "someInvalidKey"
}
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.supportedvaluesof |


Intl.DurationFormat

Intl.DurationFormat
Baseline
2025
Newly available
Since March 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The Intl.DurationFormat
object enables language-sensitive duration formatting.
Constructor
Intl.DurationFormat()
-
Creates a new
Intl.DurationFormat
object.
Static methods
Intl.DurationFormat.supportedLocalesOf()
-
Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
Instance properties
These properties are defined on Intl.DurationFormat.prototype
and shared by all Intl.DurationFormat
instances.
Intl.DurationFormat.prototype.constructor
-
The constructor function that created the instance object. For
Intl.DurationFormat
instances, the initial value is theIntl.DurationFormat
constructor. Intl.DurationFormat.prototype[Symbol.toStringTag]
-
The initial value of the
[Symbol.toStringTag]
property is the string"Intl.DurationFormat"
. This property is used inObject.prototype.toString()
.
Instance methods
Intl.DurationFormat.prototype.format()
-
Getter function that formats a duration according to the locale and formatting options of this
DurationFormat
object. Intl.DurationFormat.prototype.formatToParts()
-
Returns an
Array
of objects representing the formatted duration in parts. Intl.DurationFormat.prototype.resolvedOptions()
-
Returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.
Examples
Using Intl.DurationFormat
The examples below show how to use the Intl.DurationFormat
object to format a duration object with various locales and styles.
const duration = {
hours: 1,
minutes: 46,
seconds: 40,
};
// With style set to "long" and locale "fr-FR"
new Intl.DurationFormat("fr-FR", { style: "long" }).format(duration);
// "1 heure, 46 minutes et 40 secondes"
// With style set to "short" and locale "en"
new Intl.DurationFormat("en", { style: "short" }).format(duration);
// "1 hr, 46 min and 40 sec"
// With style set to "narrow" and locale "pt"
new Intl.DurationFormat("pt", { style: "narrow" }).format(duration);
// "1 h 46 min 40 s"
Specifications
| Specification |
|---|
| Intl.DurationFormat # durationformat-objects |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/datetimeformat/index.md

# Original Wiki contributors
mfuji09
hamishwillee
Louis-Aime
jshado1
fscholz
danielmayorga
sideshowbarker
wbamberg


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/format/index.md

# Original Wiki contributors
mfuji09
fscholz
wbamberg
sideshowbarker
SphinxKnight
battaglr
chrisdavidmills
arai
David_Gilbertson
Mingun
Sheppy
Norbert


Temporal.Now

Temporal.Now
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The Temporal.Now
namespace object contains static methods for getting the current time in various formats.
Description
Unlike most global objects, Temporal.Now
is not a constructor. You cannot use it with the new
operator or invoke the Temporal.Now
object as a function. All properties and methods of Temporal.Now
are static (just like the Math
object).
Most fundamentally, the system time is returned by the operating system as a time since the Unix epoch (usually millisecond-level precision, but might be nanosecond-level too). Temporal.Now.instant()
returns this time as a Temporal.Instant
object.
An instant can be interpreted in a time zone (which is the system time zone Temporal.Now.timeZoneId()
by default) in the same fashion as Temporal.Instant.prototype.toZonedDateTimeISO()
. To get a Temporal.ZonedDateTime
object, you can use Temporal.Now.zonedDateTimeISO()
. You can also get different parts of the date and time, using Temporal.Now.plainDateISO()
, Temporal.Now.plainTimeISO()
, and Temporal.Now.plainDateTimeISO()
.
For example, if the computer is set to the time zone "America/New_York", Temporal.Now.zonedDateTimeISO()
returns a zoned date-time like: 2021-08-01T10:40:12.345-04:00[America/New_York]
. In this case, Temporal.Now.plainTimeISO()
would return the time part of this zoned date-time: 10:40:12.345
. However, if you call Temporal.Now.plainTimeISO("UTC")
, it returns the time part of the zoned date-time in the UTC time zone: 14:40:12.345
. This is especially useful for cross-system communication where the other end may be expecting the time in a different time zone.
Reduced time precision
To offer protection against timing attacks and fingerprinting, the precision of the Temporal.Now
functions might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision
preference is enabled by default and defaults to 2ms. You can also enable privacy.resistFingerprinting
, in which case the precision will be 100ms or the value of privacy.resistFingerprinting.reduceTimerPrecision.microseconds
, whichever is larger.
For example, with reduced time precision, the result of Temporal.Now.instant().epochMilliseconds
will always be a multiple of 2, or a multiple of 100 (or privacy.resistFingerprinting.reduceTimerPrecision.microseconds
) with privacy.resistFingerprinting
enabled.
// reduced time precision (2ms) in Firefox 60
Temporal.Now.instant().epochMilliseconds;
// Might be:
// 1519211809934
// 1519211810362
// 1519211811670
// …
// reduced time precision with `privacy.resistFingerprinting` enabled
Temporal.Now.instant().epochMilliseconds;
// Might be:
// 1519129853500
// 1519129858900
// 1519129864400
// …
Static properties
Temporal.Now[Symbol.toStringTag]
-
The initial value of the
[Symbol.toStringTag]
property is the string"Temporal.Now"
. This property is used inObject.prototype.toString()
.
Static methods
Temporal.Now.instant()
-
Returns the current time as a
Temporal.Instant
object. Temporal.Now.plainDateISO()
-
Returns the current date as a
Temporal.PlainDate
object, in the ISO 8601 calendar and the specified time zone. Temporal.Now.plainDateTimeISO()
-
Returns the current date and time as a
Temporal.PlainDateTime
object, in the ISO 8601 calendar and the specified time zone. Temporal.Now.plainTimeISO()
-
Returns the current time as a
Temporal.PlainTime
object, in the specified time zone. Temporal.Now.timeZoneId()
-
Returns a time zone identifier representing the system's current time zone.
Temporal.Now.zonedDateTimeISO()
-
Returns the current date and time as a
Temporal.ZonedDateTime
object, in the ISO 8601 calendar and the specified time zone.
Specifications
| Specification |
|---|
| Temporal # sec-temporal-now-object |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/segmenter/index.md

# Original Wiki contributors
mpcsh
romulocintra


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/relativetimeformat/index.md

# Original Wiki contributors
longlho
mfuji09
yairEO
fscholz
sideshowbarker
DmitryMakhnev
spadgos
romulocintra
evilpie
littledan
chrisdavidmills


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/pluralrules/index.md

# Original Wiki contributors
longlho
mfuji09
fscholz
sideshowbarker
battaglr
shvaikalesh
jpmedley
Tagir-A


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/listformat/index.md

# Original Wiki contributors
longlho
mfuji09
Chris Chittleborough
wbamberg
fscholz
nakhodkiin
sideshowbarker
cbejensen
senna
SphinxKnight
facm0b
spectranaut
stof
Autapomorph
romulocintra


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/numberformat/formattoparts/index.md

# Original Wiki contributors
stockiNail
nuragic
mfuji09
wwahammy
fscholz
wbamberg
sideshowbarker
alexrussell


Intl.ListFormat.prototype.resolvedOptions()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
The resolvedOptions()
method of Intl.ListFormat
instances returns a new object with properties reflecting the options computed during initialization of this ListFormat
object.
Try it
const deListFormatter = new Intl.ListFormat("de-DE", { type: "disjunction" });
const options = deListFormatter.resolvedOptions();
console.log(options.locale);
// Expected output: "de-DE"
console.log(options.style);
// Expected output: "long"
console.log(options.type);
// Expected output: "disjunction"
Syntax
resolvedOptions()
Parameters
None.
Return value
A new object with properties reflecting the options computed during the initialization of this ListFormat
object. The object has the following properties, in the order they are listed:
locale
-
The BCP 47 language tag for the locale actually used, determined by the locale negotiation process. No Unicode extension key will be included in the output.
type
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"conjunction"
,"disjunction"
, or"unit"
. The default is"conjunction"
. style
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"long"
,"short"
, or"narrow"
. The default is"long"
.
Examples
Using resolvedOptions
const deListFormatter = new Intl.ListFormat("de-DE", { style: "short" });
const usedOptions = de.resolvedOptions();
console.log(usedOptions.locale); // "de-DE"
console.log(usedOptions.style); // "short"
console.log(usedOptions.type); // "conjunction" (the default value)
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-Intl.ListFormat.prototype.resolvedoptions |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/numberformat/formatrangetoparts/index.md


Intl.ListFormat.prototype.formatToParts()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
The formatToParts()
method of Intl.ListFormat
instances returns an array of objects representing each part of the formatted string that would be returned by format()
. It is useful for building custom strings from the locale-specific tokens.
Try it
const vehicles = ["Motorcycle", "Bus", "Car"];
const formatterEn = new Intl.ListFormat("en", {
style: "long",
type: "conjunction",
});
const formatterFr = new Intl.ListFormat("fr", {
style: "long",
type: "conjunction",
});
const partValuesEn = formatterEn.formatToParts(vehicles).map((p) => p.value);
const partValuesFr = formatterFr.formatToParts(vehicles).map((p) => p.value);
console.log(partValuesEn);
// Expected output: "["Motorcycle", ", ", "Bus", ", and ", "Car"]"
console.log(partValuesFr);
// Expected output: "["Motorcycle", ", ", "Bus", " et ", "Car"]"
Syntax
formatToParts(list)
Parameters
list
-
An iterable object, such as an Array, containing strings. Omitting it results in formatting the empty array, which could be slightly confusing, so it is advisable to always explicitly pass a list.
Return value
An Array
of objects containing the formatted list in parts. Each object has two properties, type
and value
, each containing a string. The string concatenation of value
, in the order provided, will result in the same string as format()
. The type
may be one of the following:
Examples
Using formatToParts()
const fruits = ["Apple", "Orange", "Pineapple"];
const myListFormat = new Intl.ListFormat("en-GB", {
style: "long",
type: "conjunction",
});
console.table(myListFormat.formatToParts(fruits));
// [
// { "type": "element", "value": "Apple" },
// { "type": "literal", "value": ", " },
// { "type": "element", "value": "Orange" },
// { "type": "literal", "value": " and " },
// { "type": "element", "value": "Pineapple" }
// ]
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-Intl.ListFormat.prototype.formatToParts |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/numberformat/supportedlocalesof/index.md

# Original Wiki contributors
mfuji09
fscholz
wbamberg
sideshowbarker
battaglr
arai
eduardoboucas
Mingun
Sheppy
Norbert


Intl.ListFormat.prototype.format()

Intl.ListFormat.prototype.format()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
The format()
method of Intl.ListFormat
instances returns a string with a
language-specific representation of the list.
Try it
const vehicles = ["Motorcycle", "Bus", "Car"];
const formatter = new Intl.ListFormat("en", {
style: "long",
type: "conjunction",
});
console.log(formatter.format(vehicles));
// Expected output: "Motorcycle, Bus, and Car"
const formatter2 = new Intl.ListFormat("de", {
style: "short",
type: "disjunction",
});
console.log(formatter2.format(vehicles));
// Expected output: "Motorcycle, Bus oder Car"
const formatter3 = new Intl.ListFormat("en", { style: "narrow", type: "unit" });
console.log(formatter3.format(vehicles));
// Expected output: "Motorcycle Bus Car"
Syntax
format(list)
Parameters
list
-
An iterable object, such as an Array, containing strings. Omitting it results in formatting the empty array, which could be slightly confusing, so it is advisable to always explicitly pass a list.
Return value
A language-specific formatted string representing the elements of the list.
Note:
Most of the time, the formatting returned by format()
is consistent. However, the output may vary between implementations, even within the same locale — output variations are by design and allowed by the specification. It may also not be what you expect. For example, the string may use non-breaking spaces or be surrounded by bidirectional control characters. You should not compare the results of format()
to hardcoded constants.
Examples
Using format
The following example shows how to create a List formatter using the English language.
const list = ["Motorcycle", "Bus", "Car"];
console.log(
new Intl.ListFormat("en-GB", { style: "long", type: "conjunction" }).format(
list,
),
);
// Motorcycle, Bus and Car
console.log(
new Intl.ListFormat("en-GB", { style: "short", type: "disjunction" }).format(
list,
),
);
// Motorcycle, Bus or Car
console.log(
new Intl.ListFormat("en-GB", { style: "narrow", type: "unit" }).format(list),
);
// Motorcycle Bus Car
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-Intl.ListFormat.prototype.format |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/numberformat/formatrange/index.md


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/numberformat/resolvedoptions/index.md

# Original Wiki contributors
fscholz
sideshowbarker
bkardell
battaglr
wbamberg
arai
David_Gilbertson
eduardoboucas
Mingun
Sheppy
Norbert


Intl.getCanonicalLocales()

Intl.getCanonicalLocales()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2017.
The Intl.getCanonicalLocales()
static method returns an array
containing the canonical locale names. Duplicates will be omitted and elements will be
validated as structurally valid language tags.
Try it
console.log(Intl.getCanonicalLocales("EN-US"));
// Expected output: Array ["en-US"]
console.log(Intl.getCanonicalLocales(["EN-US", "Fr"]));
// Expected output: Array ["en-US", "fr"]
try {
Intl.getCanonicalLocales("EN_US");
} catch (err) {
console.log(err.toString());
// Expected output: RangeError: invalid language tag: "EN_US"
}
Syntax
js
Intl.getCanonicalLocales(locales)
Parameters
Return value
An array containing the canonical locale names.
Examples
Using getCanonicalLocales
js
Intl.getCanonicalLocales("EN-US"); // ["en-US"]
Intl.getCanonicalLocales(["EN-US", "Fr"]); // ["en-US", "fr"]
Intl.getCanonicalLocales("EN_US");
// RangeError: invalid language tag: "EN_US"
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.getcanonicallocales |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/durationformat/index.md


Temporal.Duration.prototype.toLocaleString()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The toLocaleString()
method of Temporal.Duration
instances returns a string with a language-sensitive representation of this duration. In implementations with Intl.DurationFormat
API support, this method delegates to Intl.DurationFormat
.
Every time toLocaleString
is called, it has to perform a search in a big database of localization strings, which is potentially inefficient. When the method is called many times with the same arguments, it is better to create an Intl.DurationFormat
object and use its format()
method, because a DurationFormat
object remembers the arguments passed to it and may decide to cache a slice of the database, so future format
calls can search for localization strings within a more constrained context.
Syntax
toLocaleString()
toLocaleString(locales)
toLocaleString(locales, options)
Parameters
The locales
and options
parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
In implementations that support the Intl.DurationFormat
API, these parameters correspond exactly to the Intl.DurationFormat()
constructor's parameters. Implementations without Intl.DurationFormat
support return the exact same string as toString()
, ignoring both parameters.
locales
Optional-
A string with a BCP 47 language tag, or an array of such strings. Corresponds to the
locales
parameter of theIntl.DurationFormat()
constructor. options
Optional-
An object adjusting the output format. Corresponds to the
options
parameter of theIntl.DurationFormat()
constructor.
See the Intl.DurationFormat()
constructor for details on these parameters and how to use them.
Return value
A string representing the given duration according to language-specific conventions.
In implementations with Intl.DurationFormat
, this is equivalent to new Intl.DurationFormat(locales, options).format(duration)
.
Note:
Most of the time, the formatting returned by toLocaleString()
is consistent. However, the output may vary between implementations, even within the same locale — output variations are by design and allowed by the specification. It may also not be what you expect. For example, the string may use non-breaking spaces or be surrounded by bidirectional control characters. You should not compare the results of toLocaleString()
to hardcoded constants.
Examples
Using toLocaleString()
Basic use of this method without specifying a locale
returns a formatted string in the default locale and with default options.
const duration = Temporal.Duration.from({ hours: 1, minutes: 30, seconds: 15 });
console.log(duration.toLocaleString()); // 1 hr, 30 min, 15 sec
Specifications
| Specification |
|---|
| Temporal # sec-temporal.duration.prototype.tolocalestring |


Intl.DurationFormat.prototype.resolvedOptions()
Baseline
2025
Newly available
Since March 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The resolvedOptions()
method of Intl.DurationFormat
instances returns a new object with properties reflecting the options computed during initialization of this DurationFormat
object.
Syntax
resolvedOptions()
Parameters
None.
Return value
A new object with properties reflecting the options computed during the initialization of this DurationFormat
object. The object has the following properties, in the order they are listed:
locale
-
The BCP 47 language tag for the locale actually used, determined by the locale negotiation process. Only the
nu
Unicode extension key, if requested, may be included in the output. numberingSystem
-
The value provided for this property in the
options
argument, or using the Unicode extension key"nu"
, with default filled in as needed. It is a supported numbering system for this locale. The default is locale dependent. style
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"long"
,"short"
,"narrow"
, or"digital"
. The default is"short"
. years
,yearsDisplay
,months
,monthsDisplay
,weeks
,weeksDisplay
,days
,daysDisplay
,hours
,hoursDisplay
,minutes
,minutesDisplay
,seconds
,secondsDisplay
,milliseconds
,millisecondsDisplay
,nanoseconds
,nanosecondsDisplay
-
The values provided for these properties in the
options
argument, with defaults filled in as needed. For the valid values and defaults for each, see theoptions
argument of the constructor. fractionalDigits
Optional-
The value provided for this property in the
options
argument. It is only present if specified inoptions
. It is an integer from 0 to 9, inclusive.
Examples
Using the resolvedOptions method
const duration = new Intl.DurationFormat("en");
const usedOptions = duration.resolvedOptions();
usedOptions.locale; // "en"
usedOptions.numberingSystem; // "latn"
usedOptions.years; // "long"
usedOptions.yearsDisplay; // "auto"
usedOptions.style; // "long"
Specifications
| Specification |
|---|
| Intl.DurationFormat # sec-Intl.DurationFormat.prototype.resolvedOptions |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/now/index.md


Temporal.Now.plainDateTimeISO()

Temporal.Now.plainDateTimeISO()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The Temporal.Now.plainDateTimeISO()
static method returns the current date and time as a Temporal.PlainDateTime
object, in the ISO 8601 calendar and the specified time zone.
Syntax
Temporal.Now.plainDateTimeISO()
Temporal.Now.plainDateTimeISO(timeZone)
Parameters
timeZone
Optional-
Either a string or a
Temporal.ZonedDateTime
instance representing the time zone to interpret the system time in. If aTemporal.ZonedDateTime
instance, its time zone is used. If a string, it can be a named time zone identifier, an offset time zone identifier, or a date-time string containing a time zone identifier or an offset (see time zones and offsets for more information).
Return value
The current date and time in the specified time zone, as a Temporal.PlainDateTime
object using the ISO 8601 calendar. Has the same precision as Temporal.Now.instant()
.
Exceptions
RangeError
-
Thrown if the time zone is invalid.
Examples
Using Temporal.Now.plainDateTimeISO()
// The current date and time in the system's time zone
const dateTime = Temporal.Now.plainDateTimeISO();
console.log(dateTime); // e.g.: 2021-10-01T06:12:34.567890123
// The current date and time in the "America/New_York" time zone
const dateTimeInNewYork = Temporal.Now.plainDateTimeISO("America/New_York");
console.log(dateTimeInNewYork); // e.g.: 2021-09-30T23:12:34.567890123
Specifications
| Specification |
|---|
| Temporal # sec-temporal.now.plaindatetimeiso |


Temporal.Now.plainTimeISO()

Temporal.Now.plainTimeISO()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The Temporal.Now.plainTimeISO()
static method returns the current time as a Temporal.PlainTime
object, in the specified time zone.
Note that although the method contains "ISO" in its name, Temporal.PlainTime
objects do not have associated calendars, as the time format is not calendar-dependent.
Syntax
Temporal.Now.plainTimeISO()
Temporal.Now.plainTimeISO(timeZone)
Parameters
timeZone
Optional-
Either a string or a
Temporal.ZonedDateTime
instance representing the time zone to interpret the system time in. If aTemporal.ZonedDateTime
instance, its time zone is used. If a string, it can be a named time zone identifier, an offset time zone identifier, or a date-time string containing a time zone identifier or an offset (see time zones and offsets for more information).
Return value
The current time in the specified time zone, as a Temporal.PlainTime
object. Has the same precision as Temporal.Now.instant()
.
Exceptions
RangeError
-
Thrown if the time zone is invalid.
Examples
Using Temporal.Now.plainTimeISO()
// The current time in the system's time zone
const time = Temporal.Now.plainTimeISO();
console.log(time); // e.g.: 06:12:34.567890123
// The current time in the "America/New_York" time zone
const timeInNewYork = Temporal.Now.plainTimeISO("America/New_York");
console.log(timeInNewYork); // e.g.: 23:12:34.567890123
Specifications
| Specification |
|---|
| Temporal # sec-temporal.now.plaintimeiso |


Temporal.Now.plainDateISO()

Temporal.Now.plainDateISO()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The Temporal.Now.plainDateISO()
static method returns the current date as a Temporal.PlainDate
object, in the ISO 8601 calendar and the specified time zone.
Syntax
Temporal.Now.plainDateISO()
Temporal.Now.plainDateISO(timeZone)
Parameters
timeZone
Optional-
Either a string or a
Temporal.ZonedDateTime
instance representing the time zone to interpret the system time in. If aTemporal.ZonedDateTime
instance, its time zone is used. If a string, it can be a named time zone identifier, an offset time zone identifier, or a date-time string containing a time zone identifier or an offset (see time zones and offsets for more information).
Return value
The current date in the specified time zone, as a Temporal.PlainDate
object using the ISO 8601 calendar.
Exceptions
RangeError
-
Thrown if the time zone is invalid.
Examples
Using Temporal.Now.plainDateISO()
// The current date in the system's time zone
const date = Temporal.Now.plainDateISO();
console.log(date); // e.g.: 2021-10-01
// The current date in the "America/New_York" time zone
const dateInNewYork = Temporal.Now.plainDateISO("America/New_York");
console.log(dateInNewYork); // e.g.: 2021-09-30
Specifications
| Specification |
|---|
| Temporal # sec-temporal.now.plaindateiso |


Temporal.Now.zonedDateTimeISO()

Temporal.Now.zonedDateTimeISO()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The Temporal.Now.zonedDateTimeISO()
static method returns the current date and time as a Temporal.ZonedDateTime
object, in the ISO 8601 calendar and the specified time zone.
Syntax
Temporal.Now.zonedDateTimeISO()
Temporal.Now.zonedDateTimeISO(timeZone)
Parameters
timeZone
Optional-
Either a string or a
Temporal.ZonedDateTime
instance representing the time zone to interpret the system time in. If aTemporal.ZonedDateTime
instance, its time zone is used. If a string, it can be a named time zone identifier, an offset time zone identifier, or a date-time string containing a time zone identifier or an offset (see time zones and offsets for more information).
Return value
The current date and time in the specified time zone, as a Temporal.ZonedDateTime
object using the ISO 8601 calendar. Has the same precision as Temporal.Now.instant()
.
Exceptions
RangeError
-
Thrown if the time zone is invalid.
Examples
Using Temporal.Now.zonedDateTimeISO()
// The current date and time in the system's time zone
const dateTime = Temporal.Now.zonedDateTimeISO();
console.log(dateTime); // e.g.: 2021-10-01T06:12:34.567890123+03:00[Africa/Nairobi]
// The current date and time in the "America/New_York" time zone
const dateTimeInNewYork = Temporal.Now.zonedDateTimeISO("America/New_York");
console.log(dateTimeInNewYork); // e.g.: 2021-09-30T23:12:34.567890123-04:00[America/New_York]
Specifications
| Specification |
|---|
| Temporal # sec-temporal.now.zoneddatetimeiso |


Temporal.Now.timeZoneId()

Temporal.Now.timeZoneId()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The Temporal.Now.timeZoneId()
static method returns a time zone identifier representing the system's current time zone. Most systems will return a primary time zone identifier such as "America/New_York"
, though offset time zone identifier such as "-04:00"
is possible too. The time zone identifier returned is the default time zone used by the other Temporal.Now
methods.
Syntax
Temporal.Now.timeZoneId()
Parameters
None.
Return value
A valid time zone identifier representing the system's current time zone. The returned time zone identifier is never a non-primary time zone identifier (alias). For example, it would always return "Asia/Kolkata"
(new name) instead of "Asia/Calcutta"
(old name). For more information, see time zones and offsets.
If the implementation does not support time zones, the method always returns "UTC"
.
Examples
Getting the system's current time zone
console.log(Temporal.Now.timeZoneId()); // e.g.: "America/New_York"
Specifications
| Specification |
|---|
| Temporal # sec-temporal.now.timezoneid |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/listformat/resolvedoptions/index.md

# Original Wiki contributors
wbamberg
fscholz
SphinxKnight
rwe2020
sideshowbarker


Intl.Collator.prototype.resolvedOptions()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
The resolvedOptions()
method of Intl.Collator
instances returns a new object with properties reflecting the options computed during initialization of this Collator
object.
Try it
const numberDe = new Intl.NumberFormat("de-DE");
const numberAr = new Intl.NumberFormat("ar");
console.log(numberDe.resolvedOptions().numberingSystem);
// Expected output: "latn"
console.log(numberAr.resolvedOptions().numberingSystem);
// Expected output: "arab"
Syntax
resolvedOptions()
Parameters
None.
Return value
A new object with properties reflecting the options computed during the initialization of this Collator
object. The object has the following properties, in the order they are listed:
locale
-
The BCP 47 language tag for the locale actually used, determined by the locale negotiation process. Only the
co
,kn
, andkf
Unicode extension keys, if requested and supported, may be included in the output. usage
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"sort"
or"search"
. The default is"sort"
. sensitivity
-
The value provided for this property in the
options
argument, with default filled in as needed. It is either"base"
,"accent"
,"case"
, or"variant"
. The default is"variant"
for usage"sort"
; it's locale dependent for usage"search"
. ignorePunctuation
-
The value provided for this property in the
options
argument, with default filled in as needed. It is a boolean. The default istrue
for Thai (th
) andfalse
for all other languages. collation
-
The value provided for this property in the
options
argument, or using the Unicode extension key"co"
, with default filled in as needed. It is a supported collation type for this locale. The default is"default"
. numeric
-
The value provided for this property in the
options
argument, or using the Unicode extension key"kn"
, with default filled in as needed. It is a boolean. The default isfalse
. If the implementation does not support this Unicode extension key, this property is omitted. caseFirst
-
The value provided for this property in the
options
argument, or using the Unicode extension key"kf"
, with default filled in as needed. It is either"upper"
,"lower"
, or"false"
. The default is"false"
. If the implementation does not support this Unicode extension key, this property is omitted.
Examples
Using the resolvedOptions method
const de = new Intl.Collator("de", { sensitivity: "base" });
const usedOptions = de.resolvedOptions();
usedOptions.locale; // "de"
usedOptions.usage; // "sort"
usedOptions.sensitivity; // "base"
usedOptions.ignorePunctuation; // false
usedOptions.collation; // "default"
usedOptions.numeric; // false
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.collator.prototype.resolvedoptions |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/listformat/formattoparts/index.md

# Original Wiki contributors
wbamberg
fscholz
SphinxKnight
rwe2020
sideshowbarker


Temporal.Now.instant()

Temporal.Now.instant()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The Temporal.Now.instant()
static method returns the current time as a Temporal.Instant
object.
Syntax
js
Temporal.Now.instant()
Parameters
None.
Return value
A Temporal.Instant
object representing the current time, with potentially reduced precision.
Examples
Measuring time elapsed
The following example measures two instants in time and calculates the duration between them, and gets the total duration in milliseconds:
js
const start = Temporal.Now.instant();
// Do something that takes time
const end = Temporal.Now.instant();
const duration = end.since(start);
console.log(duration.total("milliseconds"));
Specifications
| Specification |
|---|
| Temporal # sec-temporal.now.instant |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/listformat/format/index.md

# Original Wiki contributors
mfuji09
wbamberg
fscholz
brian_
SphinxKnight
senna
rwe2020
sideshowbarker


Intl.DurationFormat.prototype.formatToParts()
Baseline
2025
Newly available
Since March 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The formatToParts()
method of Intl.DurationFormat
instances returns an array of objects representing each part of the formatted string that would be returned by format()
. It is useful for building custom strings from the locale-specific tokens.
Syntax
formatToParts(duration)
Parameters
duration
Optional-
The duration object to be formatted. It should include some or all of the following properties:
years
,months
,weeks
,days
,hours
,minutes
,seconds
,milliseconds
,microseconds
,nanoseconds
. Each property's value should be an integer, and their signs should be consistent. This can be aTemporal.Duration
object; see theTemporal.Duration
documentation for more information about these properties.
Return value
An Array
of objects containing the formatted duration in parts. Each object has two or three properties, type
, value
, and optionally unit
, each containing a string. The string concatenation of value
, in the order provided, will result in the same string as format()
. The parts can be thought of as directly obtained from calling Intl.NumberFormat.prototype.formatToParts()
with the numeric value and their respective units. All tokens that are produced by the NumberFormat
have an additional unit
property, which is the singular form of the input unit
; this is for programmatic usage and is not localized. The localized unit is output as a separate unit
token as part of the NumberFormat
result. The parts from each duration unit are concatenated together in the same fashion as calling Intl.ListFormat.prototype.formatToParts()
with { type: "unit" }
, so additional literal tokens are inserted.
Examples
The formatToParts
method enables locale-aware formatting of strings produced by DurationFormat
formatters by providing you the string in parts:
const duration = {
hours: 7,
minutes: 8,
seconds: 9,
milliseconds: 123,
microseconds: 456,
nanoseconds: 789,
};
new Intl.DurationFormat("en", { style: "long" }).formatToParts(duration);
// Returned value:
[
{ type: "integer", value: "7", unit: "hour" },
{ type: "literal", value: " ", unit: "hour" },
{ type: "unit", value: "hours", unit: "hour" },
{ type: "literal", value: ", " },
{ type: "integer", value: "8", unit: "minute" },
{ type: "literal", value: " ", unit: "minute" },
{ type: "unit", value: "minutes", unit: "minute" },
{ type: "literal", value: ", " },
{ type: "integer", value: "9", unit: "second" },
{ type: "literal", value: " ", unit: "second" },
{ type: "unit", value: "seconds", unit: "second" },
{ type: "literal", value: ", " },
{ type: "integer", value: "123", unit: "millisecond" },
{ type: "literal", value: " ", unit: "millisecond" },
{ type: "unit", value: "milliseconds", unit: "millisecond" },
{ type: "literal", value: ", " },
{ type: "integer", value: "456", unit: "microsecond" },
{ type: "literal", value: " ", unit: "microsecond" },
{ type: "unit", value: "microseconds", unit: "microsecond" },
{ type: "literal", value: ", " },
{ type: "integer", value: "789", unit: "nanosecond" },
{ type: "literal", value: " ", unit: "nanosecond" },
{ type: "unit", value: "nanoseconds", unit: "nanosecond" },
];
Specifications
| Specification |
|---|
| Intl.DurationFormat # sec-Intl.DurationFormat.prototype.formatToParts |


Intl.DurationFormat.prototype.format()

Intl.DurationFormat.prototype.format()
Baseline
2025
Newly available
Since March 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The format()
method of Intl.DurationFormat
instances formats a duration according to the locale and formatting options of this Intl.DurationFormat
object.
Syntax
format(duration)
Parameters
duration
-
The duration object to be formatted. It should include some or all of the following properties:
years
,months
,weeks
,days
,hours
,minutes
,seconds
,milliseconds
,microseconds
,nanoseconds
. Each property's value should be an integer, and their signs should be consistent. This can be aTemporal.Duration
object; see theTemporal.Duration
documentation for more information about these properties.
Return value
A string representing the given duration
formatted according to the locale and formatting options of this Intl.DurationFormat
object.
Note:
Most of the time, the formatting returned by format()
is consistent. However, the output may vary between implementations, even within the same locale — output variations are by design and allowed by the specification. It may also not be what you expect. For example, the string may use non-breaking spaces or be surrounded by bidirectional control characters. You should not compare the results of format()
to hardcoded constants.
Examples
Using format()
The following example shows how to create a Duration formatter using the English language.
const duration = {
years: 1,
months: 2,
weeks: 3,
days: 3,
hours: 4,
minutes: 5,
seconds: 6,
milliseconds: 7,
microseconds: 8,
nanoseconds: 9,
};
// Without options, style defaults to "short"
new Intl.DurationFormat("en").format(duration);
// "1 yr, 2 mths, 3 wks, 3 days, 4 hr, 5 min, 6 sec, 7 ms, 8 μs, 9 ns"
// With style set to "long"
new Intl.DurationFormat("en", { style: "long" }).format(duration);
// "1 year, 2 months, 3 weeks, 3 days, 4 hours, 5 minutes, 6 seconds, 7 milliseconds, 8 microseconds, 9 nanoseconds"
// With style set to "narrow"
new Intl.DurationFormat("en", { style: "narrow" }).format(duration);
// "1y 2mo 3w 3d 4h 5m 6s 7ms 8μs 9ns"
Using format() with different locales and styles
const duration = {
hours: 1,
minutes: 46,
seconds: 40,
};
// With style set to "long" and locale "fr-FR"
new Intl.DurationFormat("fr-FR", { style: "long" }).format(duration);
// "1 heure, 46 minutes et 40 secondes"
// With style set to "short" and locale set to "en"
new Intl.DurationFormat("en", { style: "short" }).format(duration);
// "1 hr, 46 min and 40 sec"
// With style set to "short" and locale set to "pt"
new Intl.DurationFormat("pt", { style: "narrow" }).format(duration);
// "1 h 46 min 40 s"
// With style set to "digital" and locale set to "en"
new Intl.DurationFormat("en", { style: "digital" }).format(duration);
// "1:46:40"
// With style set to "digital", locale set to "en", and hours set to "long"
new Intl.DurationFormat("en", { style: "digital", hours: "long" }).format(
duration,
);
// "1 hour, 46:40"
Using format() with the fractionalDigits option
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"
Specifications
| Specification |
|---|
| Intl.DurationFormat # sec-Intl.DurationFormat.prototype.format |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/getcanonicallocales/index.md

# Original Wiki contributors
longlho
fscholz
wbamberg
arai
nmve
Sebastianz
eduardoboucas


Intl.Collator.supportedLocalesOf()

Intl.Collator.supportedLocalesOf()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
The Intl.Collator.supportedLocalesOf()
static method returns an array containing those of the provided locales that are supported in collation without having to fall back to the runtime's default locale.
Try it
const locales = ["ban", "id-u-co-pinyin", "de-ID"];
const options = { localeMatcher: "lookup" };
console.log(Intl.Collator.supportedLocalesOf(locales, options));
// Expected output: Array ["id-u-co-pinyin", "de-ID"]
// (Note: the exact output may be browser-dependent)
Syntax
Intl.Collator.supportedLocalesOf(locales)
Intl.Collator.supportedLocalesOf(locales, options)
Parameters
locales
-
A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the
locales
argument, see the parameter description on theIntl
main page. options
Optional-
An object that may have the following property:
localeMatcher
-
The locale matching algorithm to use. Possible values are
"lookup"
and"best fit"
; the default is"best fit"
. For information about this option, see the Intl page.
Return value
An array of strings representing a subset of the given locale tags that are supported in collation without having to fall back to the runtime's default locale.
Examples
Using supportedLocalesOf()
Assuming a runtime that supports Indonesian and German but not Balinese in collation, supportedLocalesOf
returns the Indonesian and German language tags unchanged, even though pinyin
collation is not used with Indonesian, and a specialized German for Indonesia is unlikely to be supported. Note the specification of the "lookup"
algorithm here — a "best fit"
matcher might decide that Indonesian is an adequate match for Balinese since most Balinese speakers also understand Indonesian, and therefore return the Balinese language tag as well.
const locales = ["ban", "id-u-co-pinyin", "de-ID"];
const options = { localeMatcher: "lookup" };
console.log(Intl.Collator.supportedLocalesOf(locales, options));
// ["id-u-co-pinyin", "de-ID"]
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.collator.supportedlocalesof |


Temporal.Duration.prototype.years

Temporal.Duration.prototype.years
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The years
accessor property of Temporal.Duration
instances returns an integer representing the number of years in the duration.
You can know the sign of years
by checking the duration's sign
property.
The set accessor of years
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using years
js
const d1 = Temporal.Duration.from({ years: 1, months: 1 });
const d2 = Temporal.Duration.from({ years: -1, months: -1 });
const d3 = Temporal.Duration.from({ years: 1 });
const d4 = Temporal.Duration.from({ months: 12 });
console.log(d1.years); // 1
console.log(d2.years); // -1
console.log(d3.years); // 1
console.log(d4.years); // 0
// Balance d4
const d4Balanced = d4.round({
largestUnit: "years",
relativeTo: Temporal.PlainDate.from("2021-01-01"), // ISO 8601 calendar
});
console.log(d4Balanced.years); // 1
console.log(d4Balanced.months); // 0
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.years |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.months
Temporal.Duration.prototype.weeks
Temporal.Duration.prototype.days
Temporal.Duration.prototype.hours
Temporal.Duration.prototype.minutes
Temporal.Duration.prototype.seconds
Temporal.Duration.prototype.milliseconds
Temporal.Duration.prototype.microseconds
Temporal.Duration.prototype.nanoseconds


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/durationformat/resolvedoptions/index.md


Temporal.Duration.prototype.weeks

Temporal.Duration.prototype.weeks
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The weeks
accessor property of Temporal.Duration
instances returns an integer representing the number of weeks in the duration.
Unless the duration is balanced, you cannot assume the range of this value, but you can know its sign by checking the duration's sign
property. If it is balanced to a unit above weeks, the weeks
absolute value's range depends on the calendar (how many weeks are in a month or year).
The set accessor of weeks
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using weeks
js
const d1 = Temporal.Duration.from({ weeks: 1, days: 1 });
const d2 = Temporal.Duration.from({ weeks: -1, days: -1 });
const d3 = Temporal.Duration.from({ weeks: 1 });
const d4 = Temporal.Duration.from({ days: 7 });
console.log(d1.weeks); // 1
console.log(d2.weeks); // -1
console.log(d3.weeks); // 1
console.log(d4.weeks); // 0
// Balance d4
const d4Balanced = d4.round({
largestUnit: "weeks",
relativeTo: Temporal.PlainDate.from("2021-01-01"), // ISO 8601 calendar
});
console.log(d4Balanced.weeks); // 1
console.log(d4Balanced.days); // 0
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.weeks |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.years
Temporal.Duration.prototype.months
Temporal.Duration.prototype.days
Temporal.Duration.prototype.hours
Temporal.Duration.prototype.minutes
Temporal.Duration.prototype.seconds
Temporal.Duration.prototype.milliseconds
Temporal.Duration.prototype.microseconds
Temporal.Duration.prototype.nanoseconds


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/now/plaindatetimeiso/index.md


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/now/plaintimeiso/index.md


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/now/plaindateiso/index.md


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/now/zoneddatetimeiso/index.md


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/now/timezoneid/index.md


Temporal.Duration.prototype.sign

Temporal.Duration.prototype.sign
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The sign
accessor property of Temporal.Duration
instances returns 1
if this duration is positive, -1
if negative, and 0
if zero. Because a duration never has mixed signs, the sign of a duration is determined by the sign of any of its non-zero fields.
Examples
Using sign
js
const d1 = Temporal.Duration.from({ hours: 1, minutes: 30 });
const d2 = Temporal.Duration.from({ hours: -1, minutes: -30 });
const d3 = Temporal.Duration.from({ hours: 0 });
console.log(d1.sign); // 1
console.log(d2.sign); // -1
console.log(d3.sign); // 0
console.log(d1.abs().sign); // 1
console.log(d2.abs().sign); // 1
console.log(d3.abs().sign); // 0
console.log(d1.negated().sign); // -1
console.log(d2.negated().sign); // 1
console.log(d3.negated().sign); // 0
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.sign |


Intl.Collator.prototype.compare()

Intl.Collator.prototype.compare()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
The compare()
method of Intl.Collator
instances compares two
strings according to the sort order of this collator object.
Try it
const enCollator = new Intl.Collator("en");
const deCollator = new Intl.Collator("de");
const svCollator = new Intl.Collator("sv");
console.log(enCollator.compare("z", "a") > 0);
// Expected output: true
console.log(deCollator.compare("z", "ä") > 0);
// Expected output: true
console.log(svCollator.compare("z", "ä") > 0);
// Expected output: false
Syntax
js
compare(string1, string2)
Parameters
string1
,string2
-
The strings to compare against each other.
Return value
A number indicating how string1
and string2
compare to each other according to the sort order of this Intl.Collator
object:
- A negative value if
string1
comes beforestring2
; - A positive value if
string1
comes afterstring2
; - 0 if they are considered equal.
Examples
Using compare for array sort
Use the compare
function for sorting arrays. Note that the function
is bound to the collator from which it was obtained, so it can be passed directly to
Array.prototype.sort()
.
js
const a = ["Offenbach", "Österreich", "Odenwald"];
const collator = new Intl.Collator("de-u-co-phonebk");
a.sort(collator.compare);
console.log(a.join(", ")); // "Odenwald, Österreich, Offenbach"
Using compare for array search
Use the compare
function for finding matching strings in arrays:
js
const a = ["Congrès", "congres", "Assemblée", "poisson"];
const collator = new Intl.Collator("fr", {
usage: "search",
sensitivity: "base",
});
const s = "congres";
const matches = a.filter((v) => collator.compare(v, s) === 0);
console.log(matches.join(", ")); // "Congrès, congres"
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl.collator.prototype.compare |


Intl.Collator() constructor

Intl.Collator() constructor
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
The Intl.Collator()
constructor creates Intl.Collator
objects.
Try it
console.log(["Z", "a", "z", "ä"].sort(new Intl.Collator("de").compare));
// Expected output: Array ["a", "ä", "z", "Z"]
console.log(["Z", "a", "z", "ä"].sort(new Intl.Collator("sv").compare));
// Expected output: Array ["a", "z", "Z", "ä"]
console.log(
["Z", "a", "z", "ä"].sort(
new Intl.Collator("de", { caseFirst: "upper" }).compare,
),
);
// Expected output: Array ["a", "ä", "Z", "z"]
Syntax
new Intl.Collator()
new Intl.Collator(locales)
new Intl.Collator(locales, options)
Intl.Collator()
Intl.Collator(locales)
Intl.Collator(locales, options)
Note:
Intl.Collator()
can be called with or without new
. Both create a new Intl.Collator
instance.
Parameters
locales
Optional-
A string with a BCP 47 language tag or an
Intl.Locale
instance, or an array of such locale identifiers. The runtime's default locale is used whenundefined
is passed or when none of the specified locale identifiers is supported. For the general form and interpretation of thelocales
argument, see the parameter description on theIntl
main page.The following Unicode extension keys are allowed:
These keys can also be set with
options
(as listed below). When both are set, theoptions
property takes precedence. options
Optional-
An object containing the following properties, in the order they are retrieved (all of them are optional):
usage
-
Whether the comparison is for sorting a list of strings or fuzzy (for the Latin script diacritic-insensitive and case-insensitive) filtering a list of strings by key. Possible values are:
"sort"
(default)-
For sorting a list of strings.
"search"
-
For filtering a list of strings by testing each list item for a full-string match against a key. With
"search"
, the caller should only pay attention to whethercompare()
returns zero or non-zero and should not distinguish the non-zero return values from each other. That is, it is inappropriate to use"search"
for sorting/ordering.
localeMatcher
-
The locale matching algorithm to use. Possible values are
"lookup"
and"best fit"
; the default is"best fit"
. For information about this option, see Locale identification and negotiation. collation
-
Variant collations for certain locales, such as
"emoji"
,"pinyin"
,"stroke"
, and so on. Only has an effect whenusage
is"sort"
(because"search"
is underlyingly its own collation type). For a list of supported collation types, seeIntl.supportedValuesOf()
; the default is"default"
. This option can also be set through theco
Unicode extension key; if both are provided, thisoptions
property takes precedence. numeric
-
Whether numeric collation should be used, such that "1" < "2" < "10". Possible values are
true
andfalse
; the default isfalse
. This option can also be set through thekn
Unicode extension key; if both are provided, thisoptions
property takes precedence. caseFirst
-
Whether upper case or lower case should sort first. Possible values are
"upper"
,"lower"
, and"false"
(use the locale's default); the default is"false"
. This option can also be set through thekf
Unicode extension key; if both are provided, thisoptions
property takes precedence. sensitivity
-
Which differences in the strings should lead to non-zero result values. Possible values are:
"base"
-
Only strings that differ in base letters compare as unequal. Examples: a ≠ b, a = á, a = A. In the Unicode collation algorithm, this is equivalent to the primary strength level.
"accent"
-
Only strings that differ in base letters or accents and other diacritic marks compare as unequal. Examples: a ≠ b, a ≠ á, a = A. In the Unicode collation algorithm, this is equivalent to the secondary strength level.
"case"
-
Only strings that differ in base letters or case compare as unequal. Examples: a ≠ b, a = á, a ≠ A. In the Unicode collation algorithm, this is equivalent to the primary strength level with case level handling.
"variant"
-
Strings that differ in base letters, accents and other diacritic marks, or case compare as unequal. Other differences may also be taken into consideration. Examples: a ≠ b, a ≠ á, a ≠ A. In the Unicode collation algorithm, this is equivalent to the tertiary strength level.
The default is
"variant"
for usage"sort"
; it's locale dependent for usage"search"
per spec, but is usually also"variant"
. Because the core functionality of"search"
is accent-insensitive and case-insensitive filtering, setting it to"base"
makes the most sense (and perhaps"case"
). ignorePunctuation
-
Whether punctuation should be ignored. Possible values are
true
andfalse
. The default istrue
for Thai (th
) andfalse
for all other languages.
Exceptions
RangeError
-
Thrown if
locales
oroptions
contain invalid values.
Examples
Using Collator
The following example demonstrates the different potential results for a string occurring before, after, or at the same level as another:
console.log(new Intl.Collator().compare("a", "c")); // -1, or some other negative value
console.log(new Intl.Collator().compare("c", "a")); // 1, or some other positive value
console.log(new Intl.Collator().compare("a", "a")); // 0
Note that the results shown in the code above can vary between browsers and browser versions. This is because the values are implementation-specific. That is, the specification requires only that the before and after values are negative and positive.
Specifications
| Specification |
|---|
| ECMAScript® 2026 Internationalization API Specification # sec-intl-collator-constructor |


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/now/instant/index.md


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/collator/resolvedoptions/index.md

# Original Wiki contributors
mfuji09
fscholz
sideshowbarker
battaglr
wbamberg
maboa
jameshkramer
arai
eduardoboucas
Mingun
Sheppy
Norbert


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/durationformat/formattoparts/index.md