const d = Temporal.Duration.from({ hours: 1, minutes: 30 });
console.log(d.total("minutes")); // 90
console.log(d.total("hours")); // 1.5Temporal.Duration.prototype.total() / notebook
Temporal.Duration.prototype.total()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const d = Temporal.Duration.from({ months: 1 });
console.log(
d.total({ unit: "days", relativeTo: Temporal.PlainDate.from("2021-01-01") }),
); // 31