How did they manage to build the entire modern Web on a language without a standard library?
Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
21–30 of 167 posts
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#22Hang 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.
ISO 8601 allows for 2 or 6 digit years. Truncating to 2 is just incorrect, and 6 digits is absurd. And you can read the RFC without paying ISO - and you can discuss the RFC with people who have also read it instead of relying on people using the Wikipedia page to interpret and explain ISO 8601.
I have a scheduling service at work and I keep getting requests for implementing ISO 8601 timestamps but I ignore them. RFC3339 is the way forward.
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#23How 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.
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#24How 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.
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#25Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#26In Sweden, we can write dates as 28/5-25
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#27Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#28How did they manage to build the entire modern Web on a language without a standard library?
There's even worse language language for this. It's absolutely essential for an modern e-commerce, but has no official standard or spec, many thousands of libraries but they're mostly poorly maintained and geoblocked. The language itself is just a hodge podge of other languages that were popular in the past, and as a result it's worse than Perl for having too many ways to do any single thing. The major dialects may b…
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#29How 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.
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.
Re: Why are 2025/05/28 and 2025-05-28 different days in JavaScript?
#30Earlier 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.
RFC3339. ISO 8601 allows for 2 or 6 digit years. Truncating to 2 is just incorrect, and 6 digits is absurd. And you can read the RFC without paying ISO - and you can discuss the RFC with people who have also read it instead of relying on people using the Wikipedia page to interpret and explain ISO 8601. I have a scheduling service at work and I keep getting requests for implementing ISO 8601 timestamps but I ignore t…
Just found a random link to it with an image search:
https://gyazo.com/d8517f72e24c38f055e17182842b991c/max_size/...
ISO 8601 does have some strange formats...