Calendar dates

Prevent ISO week-year errors in a timesheet

Keep the ISO week-year attached to week numbers and test the dates where calendar years divide a week.

A record dated 1 January 2021 is in ISO 2020-W53. Combining its Gregorian year with its week number produces a false weekly key. A timesheet can show both the original date and the proper ISO reporting label.

The ISO week starts Monday. The Thursday in a week identifies its ISO week-year. The first ISO week is the one containing 4 January. In a Christmas or New Year report, calculate the key from the actual civil date used by the payroll or scheduling system.

Use ISO week and ordinal labels to reproduce the main comparisons.

Tests on both sides of New Year

The following examples compare observations a few calendar dates apart. Compare date differences across the same boundary to see why a short period can cross a week without containing a whole week.

Calendar records for 27 December 2024 and 30 December 2024

Inspect 2024-12-27. 2024-W52 with weekday 5 · 2024-362. Inspect 2024-12-30. 2025-W01 with weekday 1 · 2024-365.

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

The source anchors are 2024-12-27 and 2024-12-30. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

Calendar records for 2 January 2025 and 6 January 2025

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

  • Inspect 2025-01-02 · 2025-W01 with weekday 4 · 2025-002
  • Inspect 2025-01-06 · 2025-W02 with weekday 1 · 2025-006

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

The source anchors are 2025-01-02 and 2025-01-06. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Calendar records for 29 December 2026 and 3 January 2027

The source anchors are 2026-12-29 and 2027-01-03. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Applied choiceComputed value
Inspect 2026-12-292026-W53 with weekday 2 · 2026-363
Inspect 2027-01-032026-W53 with weekday 7 · 2027-003

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

29 December 2026 through 5 January 2027

If another record starts on 5 January 2027, decide which period owns that shared boundary before adding the totals. Either count it in one disjoint period or carry the overlap as a documented adjustment.

Count date transitions. 7 days. Count each civil date including both endpoints. 8 days.

The date order is 2026-12-29 followed by 2027-01-05. The calendar span reads 0y 0m 7d and the weeks-and-days row reads 1w 0d.

The boundary date 29 December 2026 contributes zero transitions before any move. Advance one for each date reached. The closed list contains the starting position as well as the reached dates, so its total is one greater for this forward interval.

Calendar records for 27 December 2028 and 30 December 2028

Inspect 2028-12-27. 2028-W52 with weekday 3 · 2028-362. Inspect 2028-12-30. 2028-W52 with weekday 6 · 2028-365.

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

The source anchors are 2028-12-27 and 2028-12-30. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

Calendar records for 2 January 2029 and 6 January 2029

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

  • Inspect 2029-01-02 · 2029-W01 with weekday 2 · 2029-002
  • Inspect 2029-01-06 · 2029-W01 with weekday 6 · 2029-006

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

The source anchors are 2029-01-02 and 2029-01-06. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Store the original date beside the weekly key

Before changing a data import, create test rows across at least one December-to-January ISO boundary. Check each original civil date and its complete week label. If the source uses a Sunday-first or fiscal calendar, preserve its actual convention independently.

Pros and cons of the approach

Pros. A padded ISO week key sorts consistently and can be joined with other records that use the same standard.

Cons. Changing the label convention can group work on different weeks. A short week number alone can repeat in every reporting year.

Keep the full key and the civil date rather than reconstructing one by combining the other's year with a number.

Reconcile the dated key with the report

Review the work location’s time zone before deriving the local date from a wall-clock timestamp in a timesheet.

Calendar records for 2 January 2030 and 6 January 2030

Inspect 2030-01-02. 2030-W01 with weekday 3 · 2030-002. Inspect 2030-01-06. 2030-W01 with weekday 7 · 2030-006.

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

The source anchors are 2030-01-02 and 2030-01-06. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

Calendar records for 29 December 2024 and 3 January 2025

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

  • Inspect 2024-12-29 · 2024-W52 with weekday 7 · 2024-364
  • Inspect 2025-01-03 · 2025-W01 with weekday 5 · 2025-003

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

The source anchors are 2024-12-29 and 2025-01-03. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Records to compare before using this method

Compare date differences across the same boundary to see why a short period can cross a week without containing a whole week.

Recorded exampleFirst settingFirst resultComparison settingComparison result
Calendar records for 29 December 2030 and 3 January 2031Inspect 2030-12-292030-W52 with weekday 7 · 2030-363Inspect 2031-01-032031-W01 with weekday 5 · 2031-003
1 February 2027 through 5 February 2027Count date transitions4 daysCount each civil date including both endpoints5 days
Calendar records for 27 December 2025 and 30 December 2025Inspect 2025-12-272025-W52 with weekday 6 · 2025-361Inspect 2025-12-302026-W01 with weekday 2 · 2025-364
Calendar records for 2 January 2026 and 6 January 2026Inspect 2026-01-022026-W01 with weekday 5 · 2026-002Inspect 2026-01-062026-W02 with weekday 2 · 2026-006
Calendar records for 29 December 2027 and 3 January 2028Inspect 2027-12-292027-W52 with weekday 3 · 2027-363Inspect 2028-01-032028-W01 with weekday 1 · 2028-003
29 April 2027 through 7 May 2027Count date transitions8 daysCount each civil date including both endpoints9 days
Calendar records for 27 December 2029 and 30 December 2029Inspect 2029-12-272029-W52 with weekday 4 · 2029-361Inspect 2029-12-302029-W52 with weekday 7 · 2029-364

Review the work location’s time zone before deriving the local date from a wall-clock timestamp in a timesheet.

17 October 2027 through 22 October 2027

If another record starts on 22 October 2027, decide which period owns that shared boundary before adding the totals. Either count it in one disjoint period or carry the overlap as a documented adjustment.

Count date transitions. 5 days. Count each civil date including both endpoints. 6 days.

The date order is 2027-10-17 followed by 2027-10-22. The calendar span reads 0y 0m 5d and the weeks-and-days row reads 0w 5d.

The boundary date 17 October 2027 contributes zero transitions before any move. Advance one for each date reached. The closed list contains the starting position as well as the reached dates, so its total is one greater for this forward interval.

Calendar records for 27 December 2026 and 30 December 2026

Inspect 2026-12-27. 2026-W52 with weekday 7 · 2026-361. Inspect 2026-12-30. 2026-W53 with weekday 3 · 2026-364.

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

The source anchors are 2026-12-27 and 2026-12-30. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

Calendar records for 2 January 2027 and 6 January 2027

The ISO week and ordinal label describe different classifications. The week belongs to the year containing that week’s Thursday. The ordinal counts forward from 1 January inside the civil year. Neither label changes the original civil date.

  • Inspect 2027-01-02 · 2026-W53 with weekday 6 · 2027-002
  • Inspect 2027-01-06 · 2027-W01 with weekday 3 · 2027-006

A reporter working from UTC timestamps should determine the desired local civil date first. A midnight rollover in the reporting zone can change the calendar key even though the original event instant remains fixed.

The source anchors are 2027-01-02 and 2027-01-06. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Questions readers may need to resolve

Why can January 1 have last year's week label?

Its week may contain a Thursday still in December. The ISO week-year follows that Thursday.

Can December be in Week 1 of the next year?

Yes. A Monday, Tuesday or Wednesday in late December can belong to a week whose Thursday occurs in January.

Do I need to pad the week number?

Use two digits with the W designator when sorting or exporting ISO labels as strings. Follow the destination's documented field format.

What does an ISO weekday of 1 mean?

Monday. Sunday is 7. Confirm the numeric convention if the destination stores its own weekday index.

How can I verify a boundary quickly?

Inspect entries around 28 December to 4 January and check how the Monday-to-Sunday week and Thursday place the label.

Do I need the clock time for a weekly report?

The key uses dates. A raw timestamp needs the report’s zone to determine the correct civil date first.

Can I subtract Week 52 from Week 2?

For a calendar-week distance, start from the actual dates. The weekly group labels span different week-years and do not encode distance on their own.

What if my business uses a custom fiscal year?

Retain that business rule and calculate its reporting period separately. The ISO week key is still useful as a common comparison.

Explore the other Daylooply articles →