Earlier quoted context omitted.
Pro tip: never ever use anything but ISO dates in UTC tz unless you're displaying it for a user in a UI.
Proer tip: never use anything but unix timestamp until presentation.
Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
51–60 of 167 posts
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#52Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#53Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#54Earlier quoted context omitted.
Kind of funny that you think the open web still exists. I mean, even Microsoft gave up and just went with Chromium, and they got the definition of almost infinite resources at their disposal. Effectively if your website doesn't run in Chrome and Safari, it won't be seen by 99% of the market.
> even Microsoft gave up Ah yes, Microsoft, the defenders of the free world.
> Ah yes, Microsoft, the defenders of the free world.
No, Microsoft, one of the few businesses in the world that has both the technical ability, and the financial muscle, to be able to develop their own browser engine.
Who still chose not to. Leaving us stuck in the duopoly of Apple and Google, even outside of our mobile phones.
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#55WAT [1] [1] https://www.destroyallsoftware.com/talks/wat
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#56Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#57How did they manage to build the entire modern Web on a language without a standard library?
Because the other languages & with bigger runtimes and more comprehensive standard libraries such as Java applets, Microsoft Silverlight, Macromedia Flash that were promoted for browsers to create "rich fat clients" were ultimately rejected for various reasons. The plugins had performance problems, security problems, browser crashes, etc.
Java applets was positioned by Sun & Netscape to be the "serious professional" language. Javascript was intended to be the "toy" language.
In 1999, Microsoft added XMLHttpRequest() to IE's Javascript engine to enable Outlook-for-web email that acted dynamically like Outlook-on-desktop without page refreshes. Other browsers copied that. (We described the early "web apps" with jargon such as "DHTML" DynamicHTML and "AJAX".) In 2004, Google further proved out Javascript capabilities for "rich interactive clients" with Gmail and Google Maps. Smoothly drag map tiles around and zooming in and out without Macromedia Flash. Even without any deliberate coordinated agenda, the industry collectively begins to turn Javascript from a toy language into the dominant language for all serious web apps. Javascript now had huge momentum. A language runtime being built into the browser without a standard library like Javascript was prioritized by the industry more than the other options like plugins that had a bigger "batteries included" library. This overwhelming industry preference for Javascript happened before Node.js for server-side apps in 2009 and before Steve Jobs supposedly killed Flash in 2010.
The situation today of Node.js devs using npm to download "leftpad()" and a hundred other dependencies to "fill in the gaps" of basic functionality comes from the history of Javascript's adoption.
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#58Hang on, slashes and year-month-day? https://en.wikipedia.org/wiki/ISO_8601 Handed down by the ISO, The Great Compromise allows YYYY-MM-DD (or YYYYMMDD if you're in a hurry) but the version with slashes I'd find ambiguous and upsetting, especially early in the month. The standard is good, and you can get it from `date -I`. Hell mend anyone who messes with the delimiters or writes the year in octal or any other heresy…
Pro tip: never ever use anything but ISO dates in UTC tz unless you're displaying it for a user in a UI.
UTC only loses information.
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#59In Sweden, we can write dates as 28/5-25
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#60How did they manage to build the entire modern Web on a language without a standard library?
The world where JavaScript has a robust standard library is one where there is only one browser vendor who gets to call all the shots regarding what the web looks like. That is not a better world.
also this could've been handled easily by committee(ugh), or a 3rd party open source organization akin to linux foundation that just makes js library that all browser vendors use. Or making just a specification for JS handling things.
you know - like a lot of other languages are handled, including their standard library.