Checking an ordinal date after February in leap and nonleap years
March 1 is day 61 of a leap year and day 60 of a common year, because February holds an extra date before it. The day-of-year count starts at 1 on January 1.
The ordinal date
A day-of-year number, also called an ordinal date, counts the calendar days since the start of the year, with January 1 as day 1. It is useful in logistics, astronomy, agriculture and data processing because a single integer replaces a month and a day. The day-of-year tool computes ordinal(date) minus ordinal(January 1) plus 1, where the plus 1 makes the count one-based. The value ranges from 1 to 365 in a common year and 1 to 366 in a leap year. ISO 8601 has a matching written form, the year, a hyphen and a three-digit day, such as 2024-061 for March 1 of 2024.
Counting the dates before March 1
To reach March 1, add up every date before it. January has 31 dates. February has 28 in a common year and 29 in a leap year. In 2023 that is 31 + 28 = 59 dates before March, so March 1 is day 60. In 2024 it is 31 + 29 = 60 dates, so March 1 is day 61. The tool agrees with both counts. The one-day shift appears for every date after February 28 and persists to December 31: the last day of 2023 is day 365 and the last day of 2024 is day 366. Dates in January and February have the same ordinal in both years until the leap day itself arrives.
A date in October
The shift carries through the rest of the year. Take 2026-10-19, a common year. The months before October have 31, 28, 31, 30, 31, 30, 31, 31 and 30 dates, a total of 273. Adding the 19 days of October gives day 292. In a leap year the same calendar date would be day 293. A table or script that hard-codes the cumulative month lengths for a common year will therefore be off by one for every date from March 1 to the end of a leap year. Checking one date, such as March 1, against the tool is a quick test of such code.
Spans inside one year
Within a single year, subtracting two ordinals gives the elapsed days. March 1, 2024 is day 61 and December 1, 2024 is day 336, so the interval is 275 days. The same dates in 2023 are day 60 and day 335, and the interval is again 275, because both dates fall after the leap day and the extra date cancels. Starting from January 1 changes the result. January 1 to December 1 is 335 days in 2024 and 334 in 2023, since the interval now contains February 29 only in the leap year. A span that contains the leap day is one day longer, and one that begins after it is not.
Which years are leap years
Under the Gregorian calendar, a year is a leap year if it is divisible by 4, except that century years are leap years only when divisible by 400. So 2024 and 2028 are leap years, 1900 and 2100 are not, and 2000 was. The rule averages 365.2425 days per year, which tracks the tropical year closely. The tool applies the calendar rule to the entered date, so a date in 2100 will give March 1 as day 60. Likewise 2000 was a leap year, so March 1, 2000 is day 61, while March 1, 1900 is day 60. The leap-day rule also explains why 2024-02-29 is day 60 and falls on the same position as March 1 in a common year. People often assume that every fourth year is a leap year and miss the century exceptions, which is a source of errors in code that spans the year 2100.
Day of year is not the astronomical Julian date
Some industries call the day of year a Julian date, for example on some packaged goods and in plant production records. That is a different thing from the Julian Day Number used in astronomy, which counts days continuously from noon on January 1, 4713 BC in the Julian calendar. A code such as 24061 may mean the year 24 and ordinal day 61 in one system and something unrelated in another. When exchanging ordinal dates, state the format, for example year plus three-digit day, and keep the full four-digit year so the leap-year rule can be applied correctly.
Keep the year with the ordinal
An ordinal day number is ambiguous after February without its year. Day 60 is February 29 in 2024 and March 1 in 2023, and day 61 is March 1 in 2024 and March 2 in 2023. Data that stores only the day number, a sensor that logs by ordinal date or a spreadsheet column labeled day of year loses the means to recover the calendar date unless the year is available. The check on this page uses full dates for that reason. Keeping the year costs four digits and prevents a one-day error for the ten months from March to December.
What the number does not say
The day of year is a position in the calendar. It does not identify a time of day, a time zone or an elapsed duration, and subtracting two ordinals gives a day difference only when both are in the same year. Across a year boundary, the day count has to add the length of the earlier year, 365 or 366. For the difference between two full dates, use the date-difference tool, which handles leap years without a separate step. The ordinal is best for labeling a date or locating it within a year. To convert a day number back to a date, subtract the cumulative length of the months before it: day 61 in 2024 minus January and February (31 + 29 = 60) leaves 1, which is March 1. In 2023 the same subtraction uses 59 and day 61 becomes March 2. Running the arithmetic both ways is a reliable way to confirm a table or a script.
Using the checks
The three worked values, 61 for 2024-03-01, 60 for 2023-03-01 and 1 for 2024-01-01, form a small test set for any ordinal-date code. Add 2023-12-31, which should return 365, and 2024-12-31, which should return 366, to cover the year ends. The test confirms both the leap-day shift and the one-based start. They are checks of the arithmetic only. They do not determine fiscal-year positions, week numbers, or the dates of observances, and they follow the Gregorian leap-year rule.
Reproduce the checks
Leap-year March first
Open the Day Of Year Calculator and enter:
- Calendar date
2024-03-01
Expected output:
Day of year
61The leap day appears before this date.
Nonleap-year March first
Open the Day Of Year Calculator and enter:
- Calendar date
2023-03-01
Expected output:
Day of year
60There is one fewer preceding date.
First-day convention
Open the Day Of Year Calculator and enter:
- Calendar date
2024-01-01
Expected output:
Day of year
1The ordinal is one-based.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- Primary definition and convention reference ↗ · 2026-10-08