Week year differs from calendar year
The week-based year pattern can assign dates near New Year to a different year than the calendar year. Use the calendar year pattern when reporting ordinary dates.
Clear note on java / time. "Week year differs from calendar year" is the kind of detail that is easy to overlook.
The week-based-year pattern uses the year that contains the week, so a date close to January 1 can show the neighboring year. For ordinary date reporting, use the calendar year pattern instead.
In
DateTimeFormatter,yyyyis year-of-era anduuuuis the proleptic year, which differ for dates before year 1. If you have hit a variant of this, share it below.Week-based year and calendar year diverge for dates near New Year, which can mislabel reports. Use the calendar year field whenever the output is ordinary dates rather than ISO week numbering.
Appreciate the write-up on "Week year differs from calendar year". Useful for anyone using java / time.
Appreciate the write-up on "Week year differs from calendar year". Useful for anyone using java / time.
Appreciate the write-up on "Week year differs from calendar year". Useful for anyone using java / time.
Clear note on java / time. "Week year differs from calendar year" is the kind of detail that is easy to overlook.
Specific and to the point: "Week year differs from calendar year". Worth a look if you touch java / time.