4 ms·
Free versions of the actual specs: https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf https://www.loc.gov/standards/dateti
by em500 6y ago
Free versions of the actual specs:
https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_i...
https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0039_iso_wd_8601-2_2016-02-16.pdf https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0039_i...
Or https://www.iso.org/obp/ui/#iso:std:iso:8601:-1:ed-1:v1:en https://www.iso.org/obp/ui/#iso:std:iso:8601:-1:ed-1:v1:en
The ISO8601 yyyy-mm-dd format is fine and intuitive. What trips people up all the time is the ISO8601 yyyy-www-d format (year-week-weekday)[1]. People who know it well can appreciate the benefits. But it's deeply unintuitive to people who encounter it for the first time, that the year in yyyy-www-d sometimes differes from the year in the yyyy-mm-dd format. And a perpetual source of bugs when inexperienced devs use the wrong year specifier (https://news.ycombinator.com/item?id=18762988 https://news.ycombinator.com/item?id=18762988).
The biggest wart in the spec IMO is the (optional) T in 2021-02-26T09:24, which makes the datetime format much harder to read for humans.
[1] https://en.wikipedia.org/wiki/ISO_week_date https://en.wikipedia.org/wiki/ISO_week_date
- AlanYx 6y agoThe "week date" format (yyyy-www-d) in ISO8601 is IMHO why it's usually better to refer to RFC3339, which doesn't allow the week date format. So many people are unaware that the ISO8601 format allows "week date" and/or don't understand its quirks, and articles like this one, which don't even mention that ISO8601 dates can appear in this format, compound the problem.
- rswail 6y agoWhat about the Durations and Intervals? The "Week" format is great for planning purposes, because it allows a granularity between days and months with another whole number per year. Saying that a task will begin 2021-W08 and then defining the start of the week (ISO8601 says its a Monday), tells you exactly when it will start. Saying the task is 2021-W08/P4D tells you exactly when it starts and how long it will take. Or P4D/2021-02-25 says the same thing but in terms of when it will end. They're just as unambigious and just as useful.
- nemetroid 6y agoWeek numbering introduces confusion when interacting with countries like the U.S. where weeks aren't considered to start on Mondays.
- EdwardDiego 6y agoYeah I am a fan of ISO-8601 durations.
- athorax 6y agoIt does mention it though, FTA: ...and a calendar where the year is separated not by months but by weeks, which is used in finances, but here we’re only interested in the basics.
- notatoad 6y agoi don't think mentioning it in the context of specifically excluding it is going to cause any confusion though.
- diggernet 6y agoThose two LoC links are for the 2016 draft of the 2019 specification. Hard to say how much it varies. And the ISO link only lets you see the definition of terms and symbols. Actual syntax details are all locked up. https://www.loc.gov/standards/datetime/ https://www.loc.gov/standards/datetime/ seems to be a usable summary of the 2019 spec, though being just a summary means it probably excludes discussion of finer details and considerations which might be important at times.