How to interpret a day-of-year value in a date export

Convert a numbered day within a known year instead of treating it as a day of the month.

  • Workspace tool
  • Updated
  • Reading time3 min (622 words)
  • Share

By Relwick · Published

A date export contains a year and a value such as 060. That value cannot be entered as the day of a month, but it may represent a valid date under a documented day-of-year convention.

The year is essential because leap years change the mapping after February begins to diverge.

Quick answer & key takeaways

A documented day-of-year value counts days within a particular year rather than naming a month and day. Confirm the year and whether counting starts at one before converting it. Under ordinary one-based Gregorian counting, day 60 is 29 February in 2024 and 1 March in 2025. Do not infer this encoding from a three-digit number alone or discard the year during conversion.

  • Confirm the source defines the value as a day within the year.
  • Keep the year and counting convention with the number.
  • Validate the resulting date before using it elsewhere.

Read the export definition

Look for a schema, column description, or export setting that identifies the value. A three-digit field could be a sequence number, a code, or a date component. Labels such as ordinal or Julian can also be used ambiguously, so request the exact convention instead of guessing from the label.

Python’s date-format documentation distinguishes day of the year from day of the month. Its day-of-year representation uses values such as 001 through 366. This is one documented convention; check whether the system that produced your file uses the same starting point and calendar.

Check the leap-year boundary

One-based Gregorian valueCalendar date
2024, day 0011 January 2024.
2024, day 06029 February 2024.
2025, day 0601 March 2025.
2025, day 366Outside that year’s 365-day range.

The day-60 examples were checked with calendar-date operations. The same day number maps differently because 2024 contains 29 February and 2025 does not. A conversion that drops the year cannot preserve this distinction.

Do not allow an out-of-range value to roll silently into the following year unless the source format explicitly defines that behaviour. A valid-looking January result can conceal an invalid input for the stated year.

Convert and cross-check the value

Preserve the original field and create a separate converted value. Under a confirmed one-based convention, day 1 is the first day of the year, so the offset from that date is the day number minus one. A zero-based convention would require different handling.

Verify several known records and at least one boundary relevant to the dataset. Check the start of the year, the leap-day region, and the last valid day when present. Do not rely only on a midyear example that happens to look plausible.

Keep the recovered date in an unambiguous form and document the conversion convention. This allows someone reviewing the records to trace the result back to its source rather than treating the replacement column as unexplained truth.

Enter the recovered calendar date

Age on a date expects a complete calendar date and does not import day-of-year codes. Enter the verified year, month, and day only after the source encoding has been resolved.

If the export provides no year, an exact date remains unavailable. Obtain the missing component from the source record. Choosing the current year or a convenient leap year would introduce information that the record did not supply.

Frequently asked questions

Is 060 always 1 March?

No. Under one-based Gregorian counting it is 29 February in a leap year such as 2024.

Can a three-digit number alone prove this date format?

No. Confirm the field definition and required year before converting it.

Should day 366 in a non-leap year become 1 January automatically?

Do not silently roll it forward. Check the source convention and resolve an invalid value.

Sources and further reading

Summary

A day-of-year value is meaningful only with its year and convention. Preserve that context through conversion and verification.

Related guides

Browse all guides →