3 ms·
In defense of Java's SimpleDateFormat, it's purposefully designed to be compatible with the ICU formatting. The choice of 'Y' for the rarely used "week year" i
by papercrane 2y ago
In defense of Java's SimpleDateFormat, it's purposefully designed to be compatible with the ICU formatting.
The choice of 'Y' for the rarely used "week year" is unfortunate. For those unaware, in ISO-8601 every year has either 52 or 53 full weeks. If you want to format a date like "2023-W52-6" (the 6th day of the 52nd week of 2024) you would use "YYYY-'W'ww-u".
https://unicode-org.github.io/icu/userguide/format_parse/datetime/ https://unicode-org.github.io/icu/userguide/format_parse/dat...
- plorkyeran 2y agoUnfortunately ICU's mistake here has spread to a lot of places because deferring to what ICU does is nearly always the correct decision even if you aren't actually using ICU.