[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat [Back]  [Original]

Intl.DurationFormat - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

Intl.DurationFormat

Baseline 2025

20253

Intl.DurationFormat

Intl.DurationFormat()

Intl.DurationFormat

Intl.DurationFormat.supportedLocalesOf()

Intl.DurationFormat.prototype Intl.DurationFormat

Intl.DurationFormat.prototype.constructor

Intl.DurationFormat Intl.DurationFormat

Intl.DurationFormat.prototype[Symbol.toStringTag]

[Symbol.toStringTag] "Intl.DurationFormat" Object.prototype.toString()

Intl.DurationFormat.prototype.format()

DurationFormat

Intl.DurationFormat.prototype.formatToParts()

(Array)

Intl.DurationFormat.prototype.resolvedOptions()

Intl.DurationFormat

Intl.DurationFormat

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

//  "long"  "ja-JP" 
new Intl.DurationFormat("ja-JP", { style: "long" }).format(duration);
// "1  46  40 "

//  "short"  "en" 
new Intl.DurationFormat("ja-JP", { style: "short" }).format(duration);
// "1 hr, 46 min and 40 sec"

//  "narrow"  "ja-JP" 
new Intl.DurationFormat("ja-JP", { style: "narrow" }).format(duration);
// "1h46m40s"

Intl.DurationFormat
# durationformat-objects


Web Proxy Viewer  |  New URL  |  Original Page