Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// Using @js-temporal/polyfill import { Temporal } from "@js-temporal/polyfill"; const today = Temporal.PlainDate.today(); // { year: 2024, month: 6, day: 15 } const tomorrow = today.add({ days: 1 }); const inNY = Temporal.Now.zonedDateTimeISO("America/New_York"); // Duration arithmetic const duration = Temporal.Duration.from({ hours: 5, minutes: 30 }); const later = Temporal.Now.plainTimeISO().add(duration);
Result
Open