TLDR Dev · MISCELLANEOUS

JAVASCRIPT THINKS EVERYTHING'S A DATE

futuresearch.ai6 min read

Summary from the TLDR Dev newsletter

JavaScript's `new Date(someString)` constructor is very open, attempting to parse nearly any string into a date. This has some absurd outcomes like interpreting "Route 66" as January 1, 1966, or "Beverly Hills, 90210" as January 1, year 90,210. This behavior comes from legacy parsers in engines like V8 and SpiderMonkey, which aggressively guess date components and introduce timezone inconsistencies.