Intl.DateTimeFormat
Creates an Intl.DateTimeFormat object that enables language-sensitive date and time formatting
Syntax
new Intl.DateTimeFormat(locales?, options?)Parameters
| Parameter | Type | Description |
|---|---|---|
| locales | string | string[] | A BCP 47 language tag or array of tags |
| options | Intl.DateTimeFormatOptions | Options for date/time formatting (dateStyle, timeStyle, etc.) |
Return Value
An Intl.DateTimeFormat object with a format() method
Examples
const fmt = new Intl.DateTimeFormat('en-US')
console.log(fmt.format(new Date())) // '3/7/2026'const fmt = new Intl.DateTimeFormat('en-US', {
dateStyle: 'full',
timeStyle: 'short'
})
console.log(fmt.format(new Date()))const fmt = new Intl.DateTimeFormat('ja-JP', {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long'
})
console.log(fmt.format(new Date()))Understanding Intl.DateTimeFormat
The Intl.DateTimeFormat method in JavaScript creates an Intl.DateTimeFormat object that enables language-sensitive date and time formatting. It belongs to the Intl object and is one of the most widely used methods for working with intl values in modern JavaScript and TypeScript applications.
The method signature is new Intl.DateTimeFormat(locales?, options?). It accepts 2 parameters: locales, options. When called, it returns an intl.datetimeformat object with a format() method. Understanding when and how to use DateTimeFormat() helps you write more expressive, readable code.
Common use cases for Intl.DateTimeFormat include data transformation, input validation, API response processing, and building reusable utility functions. It works well alongside related methods like intl-datetimeformat-format, intl-datetimeformat-formattoparts, intl-relativetimeformat, enabling you to chain operations together for complex data manipulation pipelines.
Browser support for Intl.DateTimeFormat is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. It is also fully supported in Node.js and Deno. For older environments, transpilation with Babel or a polyfill may be needed.
Browser Compatibility
Supported in all modern browsers (Chrome, Firefox, Safari, Edge) and Node.js. Part of the ECMAScript standard.
Related Methods
Intl.DateTimeFormat.prototype.formatFormats a date according to the locale and formatting options of this Intl.DateTimeFormat object
Intl.DateTimeFormat.prototype.formatToPartsFormats a date into an array of objects representing the formatted date in parts
Intl.RelativeTimeFormatCreates an Intl.RelativeTimeFormat object that enables language-sensitive relative time formatting
More Intl Methods
Other methods in the Intl object
Related Tools
More Intl Methods
Explore JavaScript Methods
Browse our complete reference of 410 JavaScript methods with syntax, examples, and explanations.