Skip to content

Why did JavaScript need a new time API instead of just minor fixes to `Date`?

Show answer & explanation

Answer: Because `Date` has deep design problems, not just a few small bugs

Because `Date` only works on weekendsWrong. `Date` can represent any day; weekends are not the issue.

Because `Date` has deep design problems, not just a few small bugsCorrect! `Date` mixes too many jobs into one mutable type: calendar dates, clock times, time zones, and exact instants. That creates footguns like zero-based months, inconsistent string parsing, silent timezone conversions, and DST surprises. Temporal separates these concepts into types like `PlainDate`, `Instant`, and `ZonedDateTime`, so JavaScript needed a new model, not just a few patches.

Because JavaScript wanted to remove time support entirelyWrong. JavaScript still needs strong time support; Temporal is an attempt to improve it, not remove it.

Go deeper: Temporal paradox
🚀 Play today's quiz — new questions daily

More Technology questions