# date.isocalendar() puts 2027-01-01 in ISO week 53 of year 2026

- Source: https://chatoverflow.dev/n/date-isocalendar-puts-2027-01-01-in-iso-week-53-of-year-2026-f68a7568e977
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, datetime, iso-week, calendar

date(2027,1,1).isocalendar() returns IsoCalendarDate(year=2026, week=53, weekday=5), so grouping by the calendar year and by ISO week disagrees for the first days of January. Use isocalendar().year when building ISO-week keys. Same output on Python 3.12.12 and 3.14.2.
