A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/javascript-intl-datetimeformat-supportedlocalesof-method/ below:

JavaScript Intl DateTimeFormat supportedLocalesOf() Method

JavaScript Intl DateTimeFormat supportedLocalesOf() Method

Last Updated : 12 Jul, 2025

The Intl.DateTimeFormat.supportedLocalesOf() method is an inbuilt method in JavaScript that returns an array containing those of the provided locales that are supported in date and time formatting.

Syntax: 

Intl.DateTimeFormat.supportedLocalesOf(locales, options)

Parameters: This method accepts two parameters as mentioned above and described below: 

Return value: This method returns an array of strings representing the subset of the given locale tags that are supported in date and time formatting.

The below examples illustrate the Intl.DateTimeFormat.supportedLocalesOf() method in JavaScript:

Example 1: In this example, we will see the use of the Intl.DateTimeFormat.supportedLocalesOf() method in JavaScript.

javascript
<script>
    const geeks = ['ban', 'id-u-co-pinyin', 'de-ID'];
    const result = { localeMatcher: 'lookup' };
    let val = Intl.DateTimeFormat.supportedLocalesOf(geeks, result);
    console.log(val[0], val[1]);
</script>

Output: 

"id-u-co-pinyin" "de-ID"

Example 2: In this example, we will see the use of the Intl.DateTimeFormat.supportedLocalesOf() method in JavaScript.

javascript
<script>
    const geeks = ['ban', 'id-u-co-pinyin', 'de-ID'];
    let val = Intl.DateTimeFormat.supportedLocalesOf(geeks);
    console.log(val);
</script>

Output: 

["id-u-co-pinyin", "de-ID"]

We have a complete list of Javascript Intl methods, to check those please go through the Javascript Intl Complete Reference article.

Supported Browsers: The browsers supported by Intl.DateTimeFormat.supportedLocalesOf() method are listed below: 



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4