Intl.DurationFormat

Baseline 2025
Newly available

Since March 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The Intl.DurationFormat object enables language-sensitive duration formatting.

Constructor

Intl.DurationFormat()

Creates a new Intl.DurationFormat object.

Static methods

Intl.DurationFormat.supportedLocalesOf()

Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.

Instance properties

These properties are defined on Intl.DurationFormat.prototype and shared by all Intl.DurationFormat instances.

Intl.DurationFormat.prototype.constructor

The constructor function that created the instance object. For Intl.DurationFormat instances, the initial value is the Intl.DurationFormat constructor.

Intl.DurationFormat.prototype[Symbol.toStringTag]

The initial value of the [Symbol.toStringTag] property is the string "Intl.DurationFormat". This property is used in Object.prototype.toString().

Instance methods

Intl.DurationFormat.prototype.format()

Getter function that formats a duration according to the locale and formatting options of this DurationFormat object.

Intl.DurationFormat.prototype.formatToParts()

Returns an Array of objects representing the formatted duration in parts.

Intl.DurationFormat.prototype.resolvedOptions()

Returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.

Examples

Using Intl.DurationFormat

The examples below show how to use the Intl.DurationFormat object to format a duration object with various locales and styles.

js
const duration = {
  hours: 1,
  minutes: 46,
  seconds: 40,
};

// With style set to "long" and locale "fr-FR"
new Intl.DurationFormat("fr-FR", { style: "long" }).format(duration);
// "1 heure, 46 minutes et 40 secondes"

// With style set to "short" and locale "en"
new Intl.DurationFormat("en", { style: "short" }).format(duration);
// "1 hr, 46 min and 40 sec"

// With style set to "narrow" and locale "pt"
new Intl.DurationFormat("pt", { style: "narrow" }).format(duration);
// "1 h 46 min 40 s"

Specifications

Specification
Intl.DurationFormat
# durationformat-objects

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
DurationFormat
Chrome – Full support
Chrome 129 (Release date: 2024-09-17)
footnote Full support
Edge – Full support
Edge 129 (Release date: 2024-09-19)
footnote Full support
Firefox – Full support
Firefox 136 (Release date: 2025-03-04)
footnote Full support
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 129 (Release date: 2024-09-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 136 (Release date: 2025-03-04)
footnote Full support
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 129 (Release date: 2024-09-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Bun – Full support
Bun 1.0.3 (Release date: 2023-09-22)
footnote Full support
Deno – Full support
Deno 1.46 (Release date: 2024-08-22)
footnote Full support
Node.js – Full support
Node.js 23 (Release date: 2024-10-16)
footnote Full support
DurationFormat() constructor
Chrome – Full support
Chrome 129 (Release date: 2024-09-17)
footnote Full support
Edge – Full support
Edge 129 (Release date: 2024-09-19)
footnote Full support
Firefox – Full support
Firefox 136 (Release date: 2025-03-04)
footnote Full support
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 129 (Release date: 2024-09-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 136 (Release date: 2025-03-04)
footnote Full support
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 129 (Release date: 2024-09-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Bun – Full support
Bun 1.0.3 (Release date: 2023-09-22)
footnote Full support
Deno – Full support
Deno 1.46 (Release date: 2024-08-22)
footnote Full support
Node.js – Full support
Node.js 23 (Release date: 2024-10-16)
footnote Full support
format
Chrome – Full support
Chrome 129 (Release date: 2024-09-17)
footnote Full support
Edge – Full support
Edge 129 (Release date: 2024-09-19)
footnote Full support
Firefox – Full support
Firefox 136 (Release date: 2025-03-04)
footnote Full support
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 129 (Release date: 2024-09-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 136 (Release date: 2025-03-04)
footnote Full support
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 129 (Release date: 2024-09-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Bun – Full support
Bun 1.0.3 (Release date: 2023-09-22)
footnote Full support
Deno – Full support
Deno 1.46 (Release date: 2024-08-22)
footnote Full support
Node.js – Full support
Node.js 23 (Release date: 2024-10-16)
footnote Full support
formatToParts
Chrome – Full support
Chrome 129 (Release date: 2024-09-17)
footnote Full support
Edge – Full support
Edge 129 (Release date: 2024-09-19)
footnote Full support
Firefox – Full support
Firefox 136 (Release date: 2025-03-04)
footnote Full support
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 129 (Release date: 2024-09-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 136 (Release date: 2025-03-04)
footnote Full support
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 129 (Release date: 2024-09-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Bun – Full support
Bun 1.0.3 (Release date: 2023-09-22)
footnote Full support
Deno – Full support
Deno 1.46 (Release date: 2024-08-22)
footnote Full support
Node.js – Full support
Node.js 23 (Release date: 2024-10-16)
footnote Full support
resolvedOptions
Chrome – Full support
Chrome 129 (Release date: 2024-09-17)
footnote Full support
Edge – Full support
Edge 129 (Release date: 2024-09-19)
footnote Full support
Firefox – Full support
Firefox 136 (Release date: 2025-03-04)
footnote Full support
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 129 (Release date: 2024-09-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 136 (Release date: 2025-03-04)
footnote Full support
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 129 (Release date: 2024-09-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Bun – Full support
Bun 1.0.3 (Release date: 2023-09-22)
footnote Full support
Deno – Full support
Deno 1.46 (Release date: 2024-08-22)
footnote Full support
Node.js – Full support
Node.js 23 (Release date: 2024-10-16)
footnote Full support
supportedLocalesOf
Chrome – Full support
Chrome 129 (Release date: 2024-09-17)
footnote Full support
Edge – Full support
Edge 129 (Release date: 2024-09-19)
footnote Full support
Firefox – Full support
Firefox 136 (Release date: 2025-03-04)
footnote Full support
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 129 (Release date: 2024-09-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 136 (Release date: 2025-03-04)
footnote Full support
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 129 (Release date: 2024-09-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Bun – Full support
Bun 1.0.3 (Release date: 2023-09-22)
footnote Full support
Deno – Full support
Deno 1.46 (Release date: 2024-08-22)
footnote Full support
Node.js – Full support
Node.js 23 (Release date: 2024-10-16)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also