JavaScript Int.DateTimeFormat() constructor is “used to create objects for Intl.DateTimeFormat(), which can be called with or without a new keyword.”
Syntax
new Intl.DateTimeFormat(locales, options)
Intl.DateTimeFormat(locales, options)
Parameters
locales(optional): A string with a BCP 47 language tag or an array of such strings.
- nu: It defines the numbering system
- ca: It defines the calendar
- hc: It defines the hour cycle format
options(optional): An object that can have properties like datestyle, calender, dayperiod, formatMatcher, timezone, and many more.
Return Value
It returns a new Intl.DateTimeFormat object.
Example 1: Using Intl.DateTimeFormat() Constructor
let dateTime = new Date();
let options = {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
timeZoneName: 'short'
};
const formatter = new Intl.DateTimeFormat('en', options).format(dateTime);
console.log(formatter);
Output
Thursday, August 31, 2023 at 11:38:42 AM GMT+5:30
Example 2: Using Customized Date Format
const date = new Date('2023-08-31');
const options = { year: 'numeric', month: 'long', day: 'numeric' };
const formattedDate = new Intl.DateTimeFormat('en-US', options).format(date);
console.log(formattedDate);
Output
August 31, 2023
Browser Compatibility
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
That’s it!
Related posts
JavaScript Intl.DateTimeFormat.format() Method
JavaScript Intl DateTimeFormat formatRange() Method

Krunal Lathiya is a seasoned Computer Science expert with over eight years in the tech industry. He boasts deep knowledge in Data Science and Machine Learning. Versed in Python, JavaScript, PHP, R, and Golang. Skilled in frameworks like Angular and React and platforms such as Node.js. His expertise spans both front-end and back-end development. His proficiency in the Python language stands as a testament to his versatility and commitment to the craft.