Mrs. Tini’s arisan schedule moved on by Date and by Temporal in this browser: 31 January + a month, a copied schedule, a day in Amsterdam when the clocks…
Why it matters
A wrong date means a bill a day early, an alarm an hour off when the clocks change, a schedule across zones in a mess. Date has built-in traps (mutable, months from 0, blind to zones); Temporal was redesigned so dates are honest from the start.
The key idea
Temporal is immutable, and its zone is written down
Common mistakes
An old Date variable changes after a setMonth() elsewheresetMonth changes the object in place, and const b = a only copies the reference. Copy with new Date(a), or use Temporal: .add() always gives a new object.
+ 24 hours taken for "tomorrow" When the clocks go forward, 24 hours passing is not the same wall time tomorrow. Temporal tells them apart: add({ hours: 24 }) and add({ days: 1 }).
Temporal is undefined in my browser Temporal is still new and not in every browser. Check with typeof Temporal, and where it is missing use the @js-temporal/polyfill polyfill, which has the same API.
Try it in this playground
Date spills into the next month 31 January + setMonth: the day changes, not only the month.
A copy that changes tooconst b = a, then change b: Date’s card a turns red too.
Another zone Temporal follows the zone, Date stays in yours.
A day that is not 24 hours Amsterdam, 29 March 2026: hoursInDay 23 (needs Temporal).