date.fromisocalendar(year, week, day) returns the date for an ISO 8601 week date: the ISO year, the week number (1 to 52 or 53), and the weekday where Monday is 1 and Sunday is 7.
ISO week 1 is the week that contains the year's first Thursday, so it can start in late December. This method is the inverse of isocalendar(). datetime.fromisocalendar() returns the same day at midnight.
date.fromisocalendar() is a classmethod of datetime.date: call it on the class itself, as date.fromisocalendar(...), and it returns a new object. Import the class first, for example from datetime import date. The datetime class has a method with the same name. Added in Python 3.8.
Syntax
Pass the ISO year, the week number, and the weekday number.
python
day = date.fromisocalendar(year, week, day)
moment = datetime.fromisocalendar(year, week, day)
Call
What it does
date.fromisocalendar(2024, 1, 1)
Returns datetime.date(2024, 1, 1): Monday of week 1.
date.fromisocalendar(2025, 1, 1)
Returns datetime.date(2024, 12, 30): ISO 2025 starts in December 2024.
datetime.fromisocalendar(2024, 11, 5)
Returns datetime.datetime(2024, 3, 15, 0, 0): Friday of week 11.
The weekday follows isoweekday() numbering (Monday 1 to Sunday 7), not weekday() (Monday 0).
Method signatures
python
classmethod date.fromisocalendar(year, week, day)
classmethod datetime.fromisocalendar(year, week, day)
# week: 1..52, or 53 in long ISO years; day: 1 (Monday) .. 7 (Sunday)
Parameters
Parameter
Description
year
The ISO year, 1 to 9999. It can differ from the calendar year near 1 January.
week
The ISO week, 1 to 52, or 53 in years that have 53 ISO weeks.
day
The ISO weekday, 1 (Monday) to 7 (Sunday).
Return Value
Return Value
Description
date
The calendar date for that ISO week date (a datetime at midnight from the datetime version).
Python Examples
Example 1 — Convert ISO Week Dates to Calendar Dates
Convert Monday of week 1 in 2024 and 2025, and Friday of week 11 in 2024.
python
from datetime import date
print(date.fromisocalendar(2024, 1, 1))
print(date.fromisocalendar(2024, 11, 5))
print(date.fromisocalendar(2025, 1, 1))
Output
2024-01-01
2024-03-15
2024-12-30
How It Works
Aligned year. 1 January 2024 is a Monday, so ISO week 1 of 2024 starts on that exact day.
Week and weekday. Week 11, day 5 counts 10 full weeks plus four days from 1 January, reaching Friday 15 March.
Year boundary. ISO week 1 of 2025 contains Thursday 2 January, so its Monday is 30 December 2024.
Example 2 — Print Monday-to-Sunday Ranges for Planning
Build a helper that returns the first and last day of an ISO week, then print three weeks of 2026.
python
from datetime import date
def week_range(year, week):
monday = date.fromisocalendar(year, week, 1)
sunday = date.fromisocalendar(year, week, 7)
return monday, sunday
for week in (1, 26, 52):
start, end = week_range(2026, week)
print(f"2026-W{week:02d}: {start} to {end}")
Output
2026-W01: 2025-12-29 to 2026-01-04
2026-W26: 2026-06-22 to 2026-06-28
2026-W52: 2026-12-21 to 2026-12-27
How It Works
Monday and Sunday. Days 1 and 7 of the same ISO week give its first and last date.
Week 1 starts early. 2026 begins on a Thursday, so its week 1 runs from 29 December 2025.
Zero-padded label.{week:02d} prints week numbers as two digits, matching the ISO YYYY-Www style.
Example 3 — Detect Years That Have a Week 53
Ask for week 53 in three years and catch the ValueError for the year that only has 52 ISO weeks.
python
from datetime import date
for year in (2020, 2021, 2026):
try:
print(year, date.fromisocalendar(year, 53, 1))
except ValueError:
print(year, "has no week 53")
Output
2020 2020-12-28
2021 has no week 53
2026 2026-12-28
How It Works
Leap year rule. 2020 starts on a Wednesday and is a leap year, which gives it 53 ISO weeks.
Short year. 2021 starts on a Friday, so week 53 does not exist and Python raises ValueError.
Thursday start. 2026 begins on a Thursday, the other way to get a 53rd week.
Frequently Asked Questions
Use date.fromisocalendar(year, week, 1) for the Monday of that week (Python 3.8+).
ISO week 1 is the week containing the first Thursday of the year, so its Monday can fall in late December.
Years that start on a Thursday, and leap years that start on a Wednesday, such as 2020 and 2026.
isocalendar(), which returns the (year, week, weekday) triple for a date.
datetime.strptime(f"{year}-{week}-{day}", "%G-%V-%u") gives the same result on 3.6 and 3.7.