new Intl.DurationFormat(locales, options) builds a formatter for a duration record: an object with fields such as hours, minutes and seconds. Call format(duration) to get a locale string.
This API is new (ES2024). Always check typeof Intl.DurationFormat === "function" before using it.
The Try It page first checks that Intl.DurationFormat exists, because it is new in ES2024. In an older browser it prints a short explanation and the output above. In current browsers it runs the code for real.
How It Works
Duration object. Pass only the units you care about.
Default style. English often uses short labels such as hr and min.
One string.format joins the units for display.
Example 2 — Spell Out Units with style long
Use style: "long" for full words like hour and minutes.
The Try It page first checks that Intl.DurationFormat exists, because it is new in ES2024. In an older browser it prints a short explanation and the output above. In current browsers it runs the code for real.
How It Works
Long labels. Units are spelled out for clearer reading.
Fewer fields. Seconds were omitted, so they do not appear.
Good for sentences. Long style fits status text and summaries.
Example 3 — German Short and French Narrow
The same duration reads differently in German short style and French narrow style.
The Try It page first checks that Intl.DurationFormat exists, because it is new in ES2024. In an older browser it prints a short explanation and the output above. In current browsers it runs the code for real.
How It Works
Locale matters. German uses Std. and Min. for short style.
Narrow is compact. French narrow drops spaces around some labels.
Pick style per UI. Short for tables, long for sentences, narrow for tight spaces.
Compatibility
Browser & Runtime Support
Intl.DurationFormat is part of ES2024 (DurationFormat). Support is still growing: use a feature-detect before calling it.
✓ ES2024 · Growing support
Intl.DurationFormat
Supported in Chrome 129+, Edge 129+, Firefox 136+, Safari 18.4+ (approximate) and recent Node.js. Older engines need a guard or polyfill.
ES2024Stage / standard
Google Chrome129+ · Desktop & Mobile
Full support
Microsoft Edge129+ · Chromium based
Full support
Mozilla Firefox136+ · Desktop & Mobile
Full support
Apple Safari18.4+ · macOS & iOS
Full support
Opera115+ · Chromium based
Full support
Samsung InternetRecent versions · Android
Supported
Android WebView129+ · Chromium based
Supported
Node.js23+ · Server runtime
Supported
DenoSupported · JavaScript runtime
Supported
BunSupported · JavaScript runtime
Supported
Internet ExplorerNot supported
Not supported
Intl.DurationFormatGrowing
Bottom line: Always guard: if (typeof Intl.DurationFormat === "function"). Do not assume every user browser has it yet.
Frequently Asked Questions
It formats a duration object (hours, minutes, seconds and other units) into a locale-aware string.
Not yet. It is an ES2024 feature. Always feature-detect before calling it.
A plain object with fields such as hours, minutes and seconds. You can omit units you do not need.
Common styles are long, short, narrow and digital. Exact wording depends on the locale.
Check typeof Intl.DurationFormat === "function" and fall back to your own string builder if it is missing.