An ISO week-date has three parts
The ISO week-date identifies a week-based year, a numbered week, and a weekday. Weeks begin Monday; Monday is weekday 1 and Sunday is weekday 7. Week 1 is the Monday-to-Sunday week containing January 4, equivalently the week containing the year's first Thursday. These rules assign every complete week to the year containing its Thursday.
The week-based year is not always the date's calendar year. Late December can belong to Week 1 of the next week-year, while early January can remain in Week 52 or 53 of the previous week-year. A complete label such as 2020-W53-5 prevents the year ambiguity that arises when someone writes only “Week 53.”
January 1, 2021 remains in 2020
Input: Gregorian date 2021-01-01. Rule: move within its Monday-Sunday week to Thursday and use that Thursday's year. Process: Friday January 1 shares a week with Thursday December 31, 2020. Result: 2020-W53-5. Interpretation: the calendar year is 2021, but the ISO week-year is 2020.
NumUtility reports ISO week, numeric week, ISO weekday, and week-based year. It uses date-only UTC arithmetic, so device DST does not alter the selected date's classification. The output does not claim that every locale displays calendars Monday-first or uses ISO week numbering.
January 4 starts Week 1 in 2021
Input: Gregorian date 2021-01-04. Rule: Week 1 contains January 4 and the first Thursday. Process: January 4 is Monday, and Thursday January 7 lies in 2021. Result: 2021-W01-1. Interpretation: only three calendar days after January 1, both week number and week-year change.
This boundary shows why subtracting ISO week numbers is not an elapsed-duration calculation. January 1 and January 4 are three days apart, but their labels are W53 and W01 in different week-years. Use the Date Difference Calculator and divide Total days by seven for elapsed weeks.
Late December can belong to next year
Input: Gregorian date 2024-12-30. Rule: assign the entire Monday-Sunday week to the year containing Thursday. Process: Monday December 30 shares a week with Thursday January 2, 2025. Result: 2025-W01-1. Interpretation: an ISO reporting year can begin before January 1.
Input: 2024-12-29. Rule: Sunday remains with the week whose Thursday is December 26, 2024. Process: its ISO weekday is 7. Result: 2024-W52-7. Interpretation: adjacent dates can cross a week-year boundary, so databases should store week-year and week together.
Regional calendar weeks may differ
Many calendars display Sunday first, number the week containing January 1 as Week 1, or use locale settings that differ from ISO. Those systems can assign another label without being computationally broken; they answer a different convention. Specify ISO 8601 when exchanging data or comparing results.
NumUtility implements the ISO Thursday method: normalize the selected Gregorian date, move to its Thursday, determine the week-year, find the first Thursday anchored by January 4, and count seven-day intervals. It does not expose alternative locale rules, fiscal weeks, retail 4-4-5 calendars, or payroll calendars.
Verification and common mistakes
Check that Monday is 1, confirm which Thursday lies in the week, and report the week-year. For boundary dates, compare January 4 and the first Thursday. Common mistakes are assuming January 1 is always W01, starting weeks Sunday, pairing a week number with the calendar year, and confusing a named week with an elapsed seven-day period.
The Week 53 guide explains which week-years gain an extra numbered week. The weeks-between-dates guide handles duration. For testing, use 2021-01-01 = 2020-W53-5, 2021-01-04 = 2021-W01-1, and 2024-12-30 = 2025-W01-1. These three examples exercise both sides of the year boundary and the Monday start.
Computing by the Thursday method
Convert Sunday from zero-based software notation to ISO weekday 7, then move the selected date by `4 − ISO weekday` days to its week's Thursday. The Thursday's Gregorian year is the week-year. Find the Thursday of the week containing January 4, measure the day difference in multiples of seven, and add one. NumUtility implements this structure with UTC date-only operations.
Moving to Thursday is powerful because Thursday always lies inside the majority four-day portion of its Monday-Sunday week. It gives one unambiguous year assignment at boundaries. The method should be tested with dates on every weekday, not only Mondays.
A complete week-date label
A label such as 2025-W01-1 means Monday of Week 1 in week-year 2025. The hyphenated form keeps components distinct. Week number alone is insufficient for a database key because W01 repeats every year. Calendar year plus week number can also be wrong for late-December and early-January dates.
When grouping records, derive both week-year and week number from the same ISO algorithm. Do not take the calendar year from one field and week number from another locale setting. Store the original date as well when later auditing or converting between calendar systems.
More boundary tests
Input: 2018-12-31. Rule: use the week's Thursday. Process: Thursday is January 3, 2019. Result: 2019-W01-1. Input: 2019-12-30. Process: Thursday is January 2, 2020. Result: 2020-W01-1. Interpretation: Week 1 can start in December in consecutive examples.
Input: 2016-01-03. Process: Sunday belongs to the week whose Thursday was December 31, 2015. Result: 2015-W53-7. Interpretation: the first Sunday of a calendar year can finish the previous ISO week-year. These tests complement the 2021 and 2024 cases.
ISO week arithmetic is especially important when sorting records. Lexicographic labels should zero-pad the week as W01 through W53, and the sort key must begin with week-year. `2020-W53` correctly precedes `2021-W01`; pairing January 1, 2021 with calendar year 2021 would split one Monday-Sunday week across two reporting years. When converting an ISO week-date back to Gregorian dates, find Monday of Week 1—the Monday in the week containing January 4—then add seven days per completed week and the weekday offset. Validate that W53 actually exists in the requested week-year rather than accepting every number from 1 through 53. NumUtility currently performs the forward operation only: Gregorian date to ISO label. It does not accept a week-year/week/weekday tuple, show the week's Monday and Sunday, or generate a fiscal calendar. It also assumes the Gregorian date supplied by the HTML control; historical or non-Gregorian records require a separate conversion before ISO week labeling. For analytics, retain the source date, ISO week-year, ISO week, and ISO weekday so later readers can reproduce group membership.
ISO weekday numbering also supports reversible checks. Starting from a reported Monday, add ISO weekday minus one to recover the selected Gregorian date. Starting from Sunday, subtract six to find that week's Monday. If the reconstructed date crosses December or January, keep the same week-year label for the entire Monday-Sunday week. This prevents accidental reassignment after converting individual weekdays. When displaying an ISO week to users, include a short explanation if their regional calendar starts Sunday, because visual calendar rows can otherwise appear inconsistent even when the ISO result is correct. Software APIs may expose different week settings based on locale, so tests should call the intended ISO routine explicitly rather than inherit a user preference. Finally, ISO 8601 defines representation for information interchange; it does not require every organization to use ISO weeks for schedules, payroll, education, or fiscal reporting. Confirm the requested convention before transforming an existing week label.
Always preserve the original Gregorian date beside any derived reporting label.