Calendar dates

Read day-of-year labels in sensor exports

Distinguish an ordinal day, ISO week and Gregorian date when sorting a daily measurement file.

A file suffix 2028-060 can mean day 60 of 2028. In that leap year it is 29 February. Day 60 of a common year is 1 March. Preserve the year and the declared format when decoding a file name.

An ordinal value starts at one. To get a date from a valid ordinal, begin at 1 January and move one fewer dates. An ISO week label instead groups dates by the week containing their Thursday. It serves a different purpose when sorting daily files.

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

Records to compare before using this method

Compare an ordinal and a weekly label on dates close to the new year.

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
Calendar records for 4 April 2026 and 4 May 2026Inspect 2026-04-04Wednesday · 1 April 2026 to Thursday · 30 April 2026 · 30 calendar daysInspect 2026-05-04Friday · 1 May 2026 to Sunday · 31 May 2026 · 31 calendar 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
Calendar records for 30 June 2026 and 30 July 2026Inspect 2026-06-30Monday · 1 June 2026 to Tuesday · 30 June 2026 · 30 calendar daysInspect 2026-07-30Wednesday · 1 July 2026 to Friday · 31 July 2026 · 31 calendar 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

Check whether the calendar reference belongs to a sensor's local station or a central UTC process before asserting that a file is missing.

What belongs in the final record

Check whether the calendar reference belongs to a sensor's local station or a central UTC process before asserting that a file is missing.

Calendar records for 2 January 2030 and 6 January 2030

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 2030-01-02 · 2030-W01 with weekday 3 · 2030-002
  • Inspect 2030-01-06 · 2030-W01 with weekday 7 · 2030-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 2030-01-02 and 2030-01-06. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Calendar records for 29 December 2024 and 3 January 2025

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.

Applied choiceComputed value
Inspect 2024-12-292024-W52 with weekday 7 · 2024-364
Inspect 2025-01-032025-W01 with weekday 5 · 2025-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.

Field labels from consecutive report dates

The following examples compare observations a few calendar dates apart. Compare an ordinal and a weekly label on dates close to the new year.

Calendar records for 27 December 2024 and 30 December 2024

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-27 · 2024-W52 with weekday 5 · 2024-362
  • Inspect 2024-12-30 · 2025-W01 with weekday 1 · 2024-365

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-27 and 2024-12-30. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Calendar records for 2 January 2025 and 6 January 2025

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.

Applied choiceComputed value
Inspect 2025-01-022025-W01 with weekday 4 · 2025-002
Inspect 2025-01-062025-W02 with weekday 1 · 2025-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.

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 2026 and 3 January 2027

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.

Inspect 2026-12-29. 2026-W53 with weekday 2 · 2026-363. Inspect 2027-01-03. 2026-W53 with weekday 7 · 2027-003.

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.

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.

Calendar records for 1 March 2026 and 1 April 2026

Inspect 2026-03-01. Sunday · 1 March 2026 to Tuesday · 31 March 2026 · 31 calendar days. Inspect 2026-04-01. Wednesday · 1 April 2026 to Thursday · 30 April 2026 · 30 calendar days.

The last Gregorian date is included in a monthly civil roster. If a source records timestamps, the first instant of the next month provides a cleaner exclusive endpoint for filtering events than a hand-written last second of this month.

The source anchors are 2026-03-01 and 2026-04-01. 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 27 December 2028 and 30 December 2028

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 2028-12-27 · 2028-W52 with weekday 3 · 2028-362
  • Inspect 2028-12-30 · 2028-W52 with weekday 6 · 2028-365

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 2028-12-27 and 2028-12-30. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Calendar records for 2 January 2029 and 6 January 2029

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.

Applied choiceComputed value
Inspect 2029-01-022029-W01 with weekday 2 · 2029-002
Inspect 2029-01-062029-W01 with weekday 6 · 2029-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.

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.

Identify the format of the source label

Test 1 January, 28 February, 1 March and 31 December side by side. A leap date should move later ordinal labels by one and extend the final ordinal. A file generated from UTC instants needs a documented measurement zone before you derive the day's name.

Pros and cons of the approach

Pros. Fixed-width ordinal labels sort easily and make a missing daily observation apparent.

Cons. A bare number can be ambiguous across years, and a formatted timestamp might use a different day than the file's intended reporting zone.

Keep the source timestamp, month-and-day date and padded ordinal in the same audit extract.

Calendar records for 18 December 2026 and 18 January 2027

Inspect 2026-12-18. Tuesday · 1 December 2026 to Thursday · 31 December 2026 · 31 calendar days. Inspect 2027-01-18. Friday · 1 January 2027 to Sunday · 31 January 2027 · 31 calendar days.

The last Gregorian date is included in a monthly civil roster. If a source records timestamps, the first instant of the next month provides a cleaner exclusive endpoint for filtering events than a hand-written last second of this month.

The source anchors are 2026-12-18 and 2027-01-18. 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 27 December 2026 and 30 December 2026

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 2026-12-27 · 2026-W52 with weekday 7 · 2026-361
  • Inspect 2026-12-30 · 2026-W53 with weekday 3 · 2026-364

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 2026-12-27 and 2026-12-30. Preserve the calendar or reporting convention alongside these whole dates before deriving the label.

Calendar records for 2 January 2027 and 6 January 2027

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.

Applied choiceComputed value
Inspect 2027-01-022026-W53 with weekday 6 · 2027-002
Inspect 2027-01-062027-W01 with weekday 3 · 2027-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.

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.

Questions readers may need to resolve

How does day 001 convert back to a civil date?

Use 1 January of the chosen year and move zero dates.

Which date is day 060?

It is 1 March in a common year and 29 February in a leap year.

Can a file use ordinal day 366 every year?

Day 366 exists only in Gregorian leap years. Validate the record's actual year and formatting convention.

What does an ISO week label contribute?

It groups dates into Monday-to-Sunday periods. Keep it independent of the ordinal position within the year.

What if a daily file is created after midnight?

Check whether its timestamp means file creation or the observation date. The file naming convention should identify which one it represents.

Should I use a two-digit ordinal field?

Use three digits for consistent sorting and clarity about what the number means.

Can I infer the year from an ordinal alone?

Use a trusted source for the year. The ordinal value repeats in many years.

How do I locate a missing record across New Year?

Keep the year with the ordinal and compare consecutive calendar dates. The new year appropriately restarts at 001.

Explore the other Daylooply articles →