The Chaotic History of JavaScript Date Parsing
2025-05-28
This article unveils a quirk in JavaScript's date parsing: `2025/05/28` and `2025-05-28` represent different dates. This stems from long-standing inconsistencies in how browsers parse date strings. The article traces the evolution of date string parsing in Chrome, Firefox, and Safari since the release of the ES5 standard in 2009, highlighting their varying implementations and interpretations of the ISO 8601 standard. Ultimately, date formats like `2025-05-28` are interpreted as UTC, while others are interpreted as local time, causing confusion. The article concludes by introducing the upcoming JavaScript Temporal API, which will resolve this issue by mandating timezone information.
Read more
Development