What Is the Day of the Year?
The day of the year, also called the ordinal day, counts a date's position from the start of its calendar year.
Counting dates from January
In the Gregorian calendar, 1 January is day 1. The next date is day 2, and the count continues through the year. In an ordinary year, 31 December is day 365. In a leap year, the extra date 29 February shifts all following ordinal day numbers by one, so 31 December is day 366.
Ordinal numbers can make some reports and schedules compact. A system might describe the 100th day of the year rather than writing a month and day. But the year must still be included: day 100 occurs every year, and the calendar date depends on whether the year is a leap year.
How to calculate it
A simple human method is to count the days in all earlier months and add the date number. For 10 March in a common year, January contributes 31 days and February contributes 28, then add 10. The result is day 69. In a leap year, February has 29 days, so 10 March is day 70.
For code, prefer a tested date library or calculate the difference between the date and the first day of its year using calendar-aware operations. Be careful with time zones: converting a local date to UTC can shift it to the previous or next date. If the task is a calendar ordinal, derive it from the date in the relevant calendar rather than from an arbitrary UTC timestamp.
Ordinal dates in ISO 8601
ISO 8601 supports an ordinal date form that writes the year followed by the day number, for example 2026-069 for the 69th day of 2026. This is different from the more common year-month-day form such as 2026-03-10. A parser must know which form it is reading.
Do not confuse the day of the year with an ISO week number. The ordinal date counts individual days from 1 to 365 or 366. An ISO week groups dates into Monday-to-Sunday weeks and assigns a week-year under a separate rule.
Where it is useful
Ordinal days appear in scientific logs, manufacturing schedules, meteorology and systems that need simple within-year indexing. They can make data compact, but are less familiar to many readers than a month and day. Include a label or use a standard date format when sharing values with a general audience.
The live clock on the home page shows the day-of-year count. For leap-day rules, read What Is a Leap Year?
Quick lookup: the first of each month
Day numbers for the 1st of each month. From March onwards, leap years are one higher.
- Common year: Jan 1, Feb 32, Mar 60, Apr 91, May 121, Jun 152, Jul 182, Aug 213, Sep 244, Oct 274, Nov 305, Dec 335.
- Leap year: Jan 1, Feb 32, Mar 61, Apr 92, May 122, Jun 153, Jul 183, Aug 214, Sep 245, Oct 275, Nov 306, Dec 336.
Worked example: 5 December 2026 is 335 + 4 = day 339, because 2026 is a common year. Day 256 falls on 13 September in a common year and 12 September in a leap year. Some programmers celebrate it because 256 is 28.
Calculating it in code and spreadsheets
- Python:
date(2026, 12, 5).timetuple().tm_ydayreturns339, andstrftime("%j")returns"339". - Excel or Google Sheets:
=A2-DATE(YEAR(A2),1,0), which subtracts "day 0" of the same year. - The live clock on the home page does the same thing in JavaScript. It takes the UTC midnight of today's local date, subtracts the UTC midnight of 31 December of the previous year, and divides by 86,400,000 milliseconds.
Be careful with the name "Julian date". People often use it for the ordinal day, but in astronomy a Julian Day Number is a continuous count of days from 4713 BC, which is a different thing.
Common questions
How many days are left in the year?
Subtract the day number from 365, or from 366 in a leap year. On 5 December 2026 that leaves 26 days. The home page clock shows this figure too.
Is the day of the year the same everywhere?
It follows the local calendar date. When the date differs between two zones, as it does across the date line, so does the day number.