4 ms·
You may want to check out the contents of java.time [1] and it's subpackages to see what I mean by stuff. [1] https://docs.oracle.com/en/java/javase/17/docs/ap
by sorokod 2y ago
You may want to check out the contents of java.time [1] and it's subpackages to see what I mean by stuff.
[1] https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/package-summary.html https://docs.oracle.com/en/java/javase/17/docs/api/java.base...
- lxgr 2y agojava.time.format.DateTimeFormatter seems to still point the exact same loaded footgun (i.e. the format patterns "Y" and "y") at every junior developer that dares to use it, so I'm not sure that would have helped junior-me much. The important information I was missing was "the week-based year and the year-of-era representations of one and the same date differ on some days, but not all days, and especially not those days you're currently using in your unit tests". And even if it wouldn't – SimpleDateTime was the non-deprecated standard library method I found at the time that seemed to do my job, so that was the one I used.