Skip to content
Related Articles

Related Articles

Improve Article

JavaScript | Intl.DateTimeFormat.prototype.format() Method

  • Last Updated : 13 Sep, 2021

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


dateTimeFormat.format( date )

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

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

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

Example 1:

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);


Example 2:

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(' :: '));


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

  • Google Chrome
  • Firefox
  • Opera
  • Edge
  • IE
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :