coderef

Intl.DurationFormatBaseline · Newly available

The Intl.DurationFormat API creates a locale-aware formatter that turns an object representing a duration (such as days, hours, and minutes) into a string.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Mar 4, 2025.

Browser support

DesktopChrome
1–128Not supported
129+Supportedsince Sep 17, 2024
Current: 155
Edge
12–128Not supported
129+Supportedsince Sep 19, 2024
Current: 154
Firefox
1–135Not supported
136+Supportedsince Mar 4, 2025
Current: 157
Safari
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27
MobileChrome Android
18–128Not supported
129+Supportedsince Sep 17, 2024
Current: 155
Firefox Android
4–135Not supported
136+Supportedsince Mar 4, 2025
Current: 157
Safari iOS
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Mar 4, 2025. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: DurationFormat.

Feature detection

JS · check before using
if ("DurationFormat" in Intl || ("prototype" in Intl && "DurationFormat" in Intl.prototype)) {
  // Intl.DurationFormat is available
}

Sub-features

Support for each part of the feature (6). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Intl.DurationFormat12912913616.412913616.4
Intl.DurationFormat.DurationFormat12912913616.412913616.4
Intl.DurationFormat.format12912913616.412913616.4
Intl.DurationFormat.formatToParts12912913616.412913616.4
Intl.DurationFormat.resolvedOptions12912913616.412913616.4
Intl.DurationFormat.supportedLocalesOf12912913616.412913616.4