Skip to content
Related Articles
Open in App
Not now

Related Articles

JavaScript Intl.DateTimeFormat.format() Method

Improve Article
Save Article
Like Article
  • Last Updated : 29 Dec, 2022
Improve Article
Save Article
Like Article

The Intl.DateTimeFormat.prototype.format() method is an inbuilt method in JavaScript that is used to format a date according to the locale and formatting options of this Intl.DateTimeFormat object.


Intl.dateTimeFormat.format( date )

Parameters: This method accepts a single parameter as mentioned above and described below: 

  • date: This parameter holds the date which needs to format.

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

Example 1: In this example, we will print the specific dates, and days in three different languages and one modified pattern.


    const Geeks = { weekday: 'long', year: 
    'numeric', month: 'long', day: 'numeric' };
    const dateformat = new Date(1997, 06, 30);
    const dateTimeFormat4 = new Intl.DateTimeFormat('hi', Geeks);
    const dateTimeFormat2 = new Intl.DateTimeFormat('en-GB', Geeks);
    const dateTimeFormat1 = new Intl.DateTimeFormat('sr-RS', Geeks);
    const dateTimeFormat3 = new Intl.DateTimeFormat('en-US', Geeks);


"बुधवार, 30 जुलाई 1997"
"Wednesday, 30 July 1997"
"среда, 30. јул 1997."
"Wednesday, July 30, 1997"

Example 2: In this example, we will print the specific dates, and days in three different languages.


    var list = [new Date(2012, 08), new Date(2012, 11),
                new Date(2012, 03)];
    var geeks = { year: 'numeric', month: 'long' };
    var dateTime = new Intl.DateTimeFormat('hi', geeks);
    var result =;
    console.log(result.join(' <-> '));
    var dateTime1 = new Intl.DateTimeFormat('tr', geeks);
    var result1 =;
    console.log(result1.join(' ; '));
    var dateTime2 = new Intl.DateTimeFormat('LT', geeks);
    var result2 =;
    console.log(result2.join(' :: '));


"सितंबर 2012 <-> दिसंबर 2012 <-> अप्रैल 2012"
"Eylül 2012 ; Aralık 2012 ; Nisan 2012"
"2012 m. rugsėjis :: 2012 m. gruodis :: 2012 m. balandis"

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.prototype.format() method are listed below: 

  • Google Chrome 24 and above
  • Firefox 29 and above
  • Opera 15 and above
  • Edge 12 and above
  • IE 11 and above
  • Safari 10 and above

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!