const time = Temporal.PlainTime.from("12:34:56");
console.log(time.hour); // 12Temporal.PlainTime.prototype.hour / notebook
Temporal.PlainTime.prototype.hour
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const time = Temporal.PlainTime.from("12:34:56");
const newTime = time.with({ hour: 15 });
console.log(newTime.toString()); // 15:34:56const time = Temporal.PlainTime.from("12:34:56");
const newTime = time.add({ hours: 3 });
console.log(newTime.toString()); // 15:34:56