const d1 = Temporal.Duration.from({ hours: 1, minutes: 30 });
const d2 = Temporal.Duration.from({ hours: -1, minutes: -20 });
const d3 = d1.subtract(d2);
console.log(d3.toString()); // "PT2H50M"Temporal.Duration.prototype.subtract() / notebook
Temporal.Duration.prototype.subtract()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.