# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/durationformat/format/index.md


Temporal.Duration.prototype.seconds

Temporal.Duration.prototype.seconds
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The seconds
accessor property of Temporal.Duration
instances returns an integer representing the number of seconds in the duration.
Unless the duration is balanced, you cannot assume the range of this value, but you can know its sign by checking the duration's sign
property. If it is balanced to a unit above seconds, the seconds
absolute value will be between 0 and 59, inclusive.
The set accessor of seconds
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using seconds
js
const d1 = Temporal.Duration.from({ minutes: 1, seconds: 30 });
const d2 = Temporal.Duration.from({ minutes: -1, seconds: -30 });
const d3 = Temporal.Duration.from({ minutes: 1 });
const d4 = Temporal.Duration.from({ seconds: 60 });
console.log(d1.seconds); // 30
console.log(d2.seconds); // -30
console.log(d3.seconds); // 0
console.log(d4.seconds); // 60
// Balance d4
const d4Balanced = d4.round({ largestUnit: "minutes" });
console.log(d4Balanced.seconds); // 0
console.log(d4Balanced.minutes); // 1
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.seconds |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.years
Temporal.Duration.prototype.months
Temporal.Duration.prototype.weeks
Temporal.Duration.prototype.days
Temporal.Duration.prototype.hours
Temporal.Duration.prototype.minutes
Temporal.Duration.prototype.milliseconds
Temporal.Duration.prototype.microseconds
Temporal.Duration.prototype.nanoseconds


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/intl/collator/supportedlocalesof/index.md

# Original Wiki contributors
fscholz
wbamberg
sideshowbarker
battaglr
jameshkramer
arai
eduardoboucas
Mingun
Sheppy
Norbert


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/duration/years/index.md


Temporal.Duration.prototype.nanoseconds

Temporal.Duration.prototype.nanoseconds
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The nanoseconds
accessor property of Temporal.Duration
instances returns an integer representing the number of nanoseconds in the duration.
Unless the duration is balanced, you cannot assume the range of this value, but you can know its sign by checking the duration's sign
property. If it is balanced to a unit above nanoseconds, the nanoseconds
absolute value will be between 0 and 999, inclusive.
The set accessor of nanoseconds
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using nanoseconds
js
const d1 = Temporal.Duration.from({ microseconds: 1, nanoseconds: 500 });
const d2 = Temporal.Duration.from({ microseconds: -1, nanoseconds: -500 });
const d3 = Temporal.Duration.from({ microseconds: 1 });
const d4 = Temporal.Duration.from({ nanoseconds: 1000 });
console.log(d1.nanoseconds); // 500
console.log(d2.nanoseconds); // -500
console.log(d3.nanoseconds); // 0
console.log(d4.nanoseconds); // 1000
// Balance d4
const d4Balanced = d4.round({ largestUnit: "microseconds" });
console.log(d4Balanced.nanoseconds); // 0
console.log(d4Balanced.microseconds); // 1
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.nanoseconds |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.years
Temporal.Duration.prototype.months
Temporal.Duration.prototype.weeks
Temporal.Duration.prototype.days
Temporal.Duration.prototype.hours
Temporal.Duration.prototype.minutes
Temporal.Duration.prototype.seconds
Temporal.Duration.prototype.milliseconds
Temporal.Duration.prototype.microseconds


# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/javascript/reference/global_objects/temporal/duration/weeks/index.md


Temporal.Duration.prototype.months

Temporal.Duration.prototype.months
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The months
accessor property of Temporal.Duration
instances returns an integer representing the number of months in the duration.
Unless the duration is balanced, you cannot assume the range of this value, but you can know its sign by checking the duration's sign
property. If it is balanced to a unit above months, the months
absolute value's range depends on the calendar (how many months are in a year).
The set accessor of months
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using months
js
const d1 = Temporal.Duration.from({ years: 1, months: 1 });
const d2 = Temporal.Duration.from({ years: -1, months: -1 });
const d3 = Temporal.Duration.from({ years: 1 });
const d4 = Temporal.Duration.from({ months: 12 });
console.log(d1.months); // 1
console.log(d2.months); // -1
console.log(d3.months); // 0
console.log(d4.months); // 12
// Balance d4
const d4Balanced = d4.round({
largestUnit: "years",
relativeTo: Temporal.PlainDate.from("2021-01-01"), // ISO 8601 calendar
});
console.log(d4Balanced.months); // 0
console.log(d4Balanced.years); // 1
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.months |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.years
Temporal.Duration.prototype.weeks
Temporal.Duration.prototype.days
Temporal.Duration.prototype.hours
Temporal.Duration.prototype.minutes
Temporal.Duration.prototype.seconds
Temporal.Duration.prototype.milliseconds
Temporal.Duration.prototype.microseconds
Temporal.Duration.prototype.nanoseconds


Temporal.Duration.prototype.minutes

Temporal.Duration.prototype.minutes
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The minutes
accessor property of Temporal.Duration
instances returns an integer representing the number of minutes in the duration.
Unless the duration is balanced, you cannot assume the range of this value, but you can know its sign by checking the duration's sign
property. If it is balanced to a unit above minutes, the minutes
absolute value will be between 0 and 59, inclusive.
The set accessor of minutes
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using minutes
js
const d1 = Temporal.Duration.from({ hours: 1, minutes: 30 });
const d2 = Temporal.Duration.from({ hours: -1, minutes: -30 });
const d3 = Temporal.Duration.from({ hours: 1 });
const d4 = Temporal.Duration.from({ minutes: 60 });
console.log(d1.minutes); // 1
console.log(d2.minutes); // -1
console.log(d3.minutes); // 0
console.log(d4.minutes); // 60
// Balance d4
const d4Balanced = d4.round({ largestUnit: "hours" });
console.log(d4Balanced.minutes); // 0
console.log(d4Balanced.hours); // 1
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.minutes |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.years
Temporal.Duration.prototype.months
Temporal.Duration.prototype.weeks
Temporal.Duration.prototype.days
Temporal.Duration.prototype.hours
Temporal.Duration.prototype.seconds
Temporal.Duration.prototype.milliseconds
Temporal.Duration.prototype.microseconds
Temporal.Duration.prototype.nanoseconds


Temporal.Duration.prototype.milliseconds
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The milliseconds
accessor property of Temporal.Duration
instances returns an integer representing the number of milliseconds in the duration.
Unless the duration is balanced, you cannot assume the range of this value, but you can know its sign by checking the duration's sign
property. If it is balanced to a unit above milliseconds, the milliseconds
absolute value will be between 0 and 999, inclusive.
The set accessor of milliseconds
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using milliseconds
js
const d1 = Temporal.Duration.from({ seconds: 1, milliseconds: 500 });
const d2 = Temporal.Duration.from({ seconds: -1, milliseconds: -500 });
const d3 = Temporal.Duration.from({ seconds: 1 });
const d4 = Temporal.Duration.from({ milliseconds: 1000 });
console.log(d1.milliseconds); // 500
console.log(d2.milliseconds); // -500
console.log(d3.milliseconds); // 0
console.log(d4.milliseconds); // 1000
// Balance d4
const d4Balanced = d4.round({ largestUnit: "seconds" });
console.log(d4Balanced.milliseconds); // 0
console.log(d4Balanced.seconds); // 1
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.milliseconds |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.years
Temporal.Duration.prototype.months
Temporal.Duration.prototype.weeks
Temporal.Duration.prototype.days
Temporal.Duration.prototype.hours
Temporal.Duration.prototype.minutes
Temporal.Duration.prototype.seconds
Temporal.Duration.prototype.microseconds
Temporal.Duration.prototype.nanoseconds


Temporal.Duration.prototype.microseconds
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The microseconds
accessor property of Temporal.Duration
instances returns an integer representing the number of microseconds in the duration.
Unless the duration is balanced, you cannot assume the range of this value, but you can know its sign by checking the duration's sign
property. If it is balanced to a unit above microseconds, the microseconds
absolute value will be between 0 and 999, inclusive.
The set accessor of microseconds
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using microseconds
js
const d1 = Temporal.Duration.from({ milliseconds: 1, microseconds: 500 });
const d2 = Temporal.Duration.from({ milliseconds: -1, microseconds: -500 });
const d3 = Temporal.Duration.from({ milliseconds: 1 });
const d4 = Temporal.Duration.from({ microseconds: 1000 });
console.log(d1.microseconds); // 500
console.log(d2.microseconds); // -500
console.log(d3.microseconds); // 0
console.log(d4.microseconds); // 1000
// Balance d4
const d4Balanced = d4.round({ largestUnit: "milliseconds" });
console.log(d4Balanced.microseconds); // 0
console.log(d4Balanced.milliseconds); // 1
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.microseconds |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.years
Temporal.Duration.prototype.months
Temporal.Duration.prototype.weeks
Temporal.Duration.prototype.days
Temporal.Duration.prototype.hours
Temporal.Duration.prototype.minutes
Temporal.Duration.prototype.seconds
Temporal.Duration.prototype.milliseconds
Temporal.Duration.prototype.nanoseconds


Temporal.Duration.prototype.hours

Temporal.Duration.prototype.hours
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The hours
accessor property of Temporal.Duration
instances returns an integer representing the number of hours in the duration.
Unless the duration is balanced, you cannot assume the range of this value, but you can know its sign by checking the duration's sign
property. If it is balanced to a unit above hours, the hours
absolute value will be between 0 and 23, inclusive.
The set accessor of hours
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.Duration
object with the desired new value.
Examples
Using hours
js
const d1 = Temporal.Duration.from({ hours: 1, minutes: 30 });
const d2 = Temporal.Duration.from({ hours: -1, minutes: -30 });
const d3 = Temporal.Duration.from({ days: 1 });
const d4 = Temporal.Duration.from({ hours: 24 });
console.log(d1.hours); // 1
console.log(d2.hours); // -1
console.log(d3.hours); // 0
console.log(d4.hours); // 24
// Balance d4
const d4Balanced = d4.round({ largestUnit: "days" });
console.log(d4Balanced.hours); // 0
console.log(d4Balanced.days); // 1
Specifications
| Specification |
|---|
| Temporal # sec-get-temporal.duration.prototype.hours |
Browser compatibility
See also
Temporal.Duration
Temporal.Duration.prototype.years
Temporal.Duration.prototype.months
Temporal.Duration.prototype.weeks
Temporal.Duration.prototype.days
Temporal.Duration.prototype.minutes
Temporal.Duration.prototype.seconds
Temporal.Duration.prototype.milliseconds
Temporal.Duration.prototype.microseconds
Temporal.Duration.prototype.nanoseconds