JavaScript Temporal Duration
Temporal.Duration Object Reference
Temporal.Duration Methods
Revised March 2026
| Constructing | Description |
|---|---|
| from() | Returns a new duration object from an object or an ISO string |
| new() | Returns a new duration object from integer parameters |
| Arithmetic | |
| abs() | Returns a new duration with the absolute value of this duration |
| add() | Returns a new duration with a duration added to this duration |
| negated() | Returns a new duration with this duration negated |
| round() | Returns a new duration with this duration rounded |
| subtract() | Returns a new duration with a duration subtracted from this duration |
| Comparing | |
| compare() | Compares two durations (returning -1, 0, or 1) |
| Converting | |
| with() | Returns a new duration with specified field(s) modified |
| Formatting | |
| total() | Returns a number representing the duration in a given unit |
| toJSON() | Returns an ISO 8601 duration string for JSON serialization |
| toLocaleString() | Returns a language-sensitive representation of the time |
| toString() | Returns an ISO 8601 duration string representation |
| valueOf() | Throws a TypeError (prevents temporals from being converted to primitives) |
Temporal.Duration Properties
The Temporal.Duration object has 12 properties of time information.
| Property | Description |
|---|---|
| blank | Boolean true if the duration represents a zero duration |
| days | Days as an integer |
| hours | Hours as an integer |
| microseconds | Microseconds as an integer |
| milliseconds | Milliseconds as an integer |
| minutes | Minutes as an integer |
| months | Months as an integer |
| nanoseconds | Nanoseconds as an integer |
| seconds | Seconds as an integer |
| sign | 1 positive, 0 zero, -1 negative |
| weeks | Weeks as an integer |
| years | Years as an integer |
Learn More:
Browser Support
Temporal is a major update to the JavaScript standard (TC39).
It is currently supported in Chrome, Edge, Firefox, and Opera Safari has not shipped it yet.
| Chrome 144 |
Edge 144 |
Firefox 139 |
Safari |
Opera 128 |
| Jan 2026 | Jan 2026 | May 2025 | 🚫 | Feb 2026 |
The Safari implementation can be tested in Safari Technology Preview by enabling the --use-temporal runtime flag.
Polyfill
Until Safari supports Temporal natively, you can use the official polyfill:
<script
src="https://cdn.jsdelivr.net/npm/@js-temporal/polyfill@0.5.1/dist/index.umd.js">
</script>