TL;DR

Mat “Wilto” Marquis argues that JavaScript's built-in Date API is inconsistent, mutable, and ill-suited to representing calendar dates. The piece highlights parsing oddities, limited timezone support and the prevalence of heavy third-party workarounds, and signals a shift toward Temporal.

What happened

In a recent essay, Mat “Wilto” Marquis laid out a critique of JavaScript’s native Date constructor and urged a move away from it in favor of Temporal (title: "Date is out, Temporal is in"). The author demonstrates multiple unexpected behaviors: months are zero-indexed while years and days are not; short numeric strings map to surprising years; and slight format changes (slashes vs hyphens) can shift the interpreted day because of timezone handling. Marquis also emphasizes that Date values are implemented as objects, making them mutable references rather than immutable primitives. That design clashes with the intuition that a calendar date is a fixed concept. The piece recalls that Java deprecated its Date long ago, notes Date only recognizes local time and GMT and relies on the Gregorian calendar, and argues that many teams resort to large third-party libraries to work around these shortcomings—an approach the author says has measurable performance costs for the web.

Why it matters

  • Mutable Date objects can lead to subtle bugs when multiple references point to the same underlying time value.
  • Inconsistent parsing rules increase the risk of incorrect dates slipping into applications.
  • Limited timezone and calendar support makes worldwide and historical date handling error-prone.
  • Widespread use of heavy third-party libraries to patch Date behavior can degrade web performance.

Key facts

  • The Date constructor in JavaScript creates object values, which are mutable and referenced by variables.
  • Months passed numerically to Date are zero-indexed, while years and days are not.
  • Some numeric string inputs map to unexpected years (e.g., certain two-digit strings are interpreted as 1900s or 2000s; larger numbers may be treated differently).
  • String format differences (for example, using hyphens versus slashes) can cause Date to produce a different day due to timezone interpretation.
  • Internally, Date stores time values as numbers (Unix timestamps in milliseconds).
  • Java deprecated its own Date API in 1997; the author contrasts that with JavaScript’s continued use of Date.
  • JavaScript’s Date only recognizes local time and GMT and only models the Gregorian calendar.
  • Because of Date’s limitations, developers commonly rely on third-party libraries, some of which are large and have measurable performance impacts on the web.

What to watch next

  • Whether Temporal gains broad adoption among developers and in major libraries — not confirmed in the source
  • Browser and runtime support timelines for any standardized Temporal implementation — not confirmed in the source
  • Tooling and migration guides that help teams move existing Date-based code to Temporal — not confirmed in the source

Quick glossary

  • Date (JavaScript): A built-in constructor that creates object instances representing a point in time; in JavaScript these are mutable reference values.
  • Temporal: A newer API name referenced in the source title as an alternative to Date; generally intended to represent date/time concepts with different semantics than Date.
  • Immutable: A property of a value that cannot be changed after creation; primitives like numbers and booleans are immutable in JavaScript.
  • Mutable: Describes an object whose internal state can be altered after it is created; JavaScript objects, including Date instances, are mutable.
  • Unix timestamp: A numeric representation of a point in time, typically counting seconds or milliseconds since the Unix epoch (January 1, 1970).

Reader FAQ

Why does JavaScript's Date behave inconsistently?
According to the article, Date mixes parsing rules and representation choices (zero-indexed months, varied string parsing, timezone assumptions) that lead to inconsistent results.

Are Date values immutable?
No; Date instances are objects and therefore mutable reference values in JavaScript.

Does Date support multiple time zones and historical calendars?
The source says Date only recognizes local time and GMT and only models the Gregorian calendar.

Is Temporal ready to replace Date today?
not confirmed in the source

Do third-party libraries solve these Date problems?
The article notes many teams use external libraries to work around Date’s shortcomings, but it also warns that some of these libraries are large and can harm performance.

Date is out, Temporal is in Mat “Wilto” Marquis, 07 January 2026 Topic: JavaScript Save 15% on all of our premium courses until the end of January! CHECK OUT THE…

Sources

Related posts

By

Leave a Reply

Your email address will not be published. Required fields are marked *