Day of the Year Calculator

Results

Date Of the Year

0
1

What is Day of the Year?

The day of the year, also called an ordinal day number, counts a calendar date from the start of its year. January 1 is day 1. December 31 is day 365 in an ordinary year and day 366 in a leap year. This calculator accepts a complete calendar date and returns both its ordinal position and its year.

Ordinal day numbers are useful in schedules, logs, scientific records and data checks because they replace the month-and-day pair with one continuous count. They do not identify a date by themselves: day 60 means March 1 in an ordinary year but February 29 in a leap year, so the year must remain attached.

2

How to Use This Calculator

  1. Select or type a valid date in the date field.
  2. Choose Calculate.
  3. Read the returned day number together with the displayed year.

The calculation counts all days in completed months and then adds the day within the selected month. Month lengths are 31 days for January; 28 or 29 for February; 31 for March; 30 for April; and so on. Leap-year handling is automatic. A year is normally a leap year when divisible by 4, except century years must also be divisible by 400. Thus 2024 and 2000 are leap years, while 1900 and 2100 are not.

The browser date field normally sends a value in year-month-day form. The result describes the civil calendar date, not an elapsed 24-hour duration, timestamp or time-zone conversion.

3

Formula Used

Ordinal day = days in all months before the selected month + day of month.

For dates after February, add one extra day when the selected year is a leap year. Equivalently, January 1 starts at 1 and each next calendar date increments the count by one. The valid result range is 1–365 for an ordinary year or 1–366 for a leap year.

4

Variables Explained

ItemMeaning
DateThe complete Gregorian calendar date selected by the user.
YearThe calendar year containing the date; it determines whether February has 28 or 29 days.
MonthThe named calendar division whose preceding month lengths contribute to the count.
Day of monthThe position within the selected month, beginning at 1.
Ordinal dayThe date’s one-based position within its year.
Leap dayFebruary 29, inserted in leap years and included in later ordinal values.
5

Worked Example

For March 1, 2024, January contributes 31 days and February contributes 29 because 2024 is divisible by 4 and is not an excluded century year. Add the day of March: 31 + 29 + 1 = day 61 of 2024.

For March 1, 2023, February had 28 days, so the calculation is 31 + 28 + 1 = day 60. This one-day shift continues through the rest of a leap year. As a second check, December 31, 2024 is day 366, while December 31, 2023 is day 365.

6

Why Use This Calculator?

A result such as “day 61 of 2024” locates the date within that particular year. Keep the year when storing or sharing the value because the same ordinal can map to a different month and day in leap and ordinary years. For data interchange, ISO 8601 permits ordinal-date representations that include the year, but this page returns separate numerical fields rather than formatting a complete ISO ordinal date.

Do not subtract two ordinal values from different years without accounting for year boundaries. For elapsed time, use a date-difference calculation that defines whether endpoints are included. An ordinal day is one-based: January 1 is 1, unlike some programming indexes that start at zero.

Ordinal values are especially convenient for sorting observations within one year and spotting missing daily records. When a dataset spans several years, store a full date or a year-plus-ordinal pair. Check imported systems carefully because some “Julian day” fields mean an ordinal date, while astronomical Julian dates use a different continuous day count.

7

Common Mistakes

    • Calling January 1 day 0 instead of day 1.
    • Forgetting February 29 when a date falls after February in a leap year.
    • Assuming every year divisible by 100 is a leap year; it must also be divisible by 400.
    • Dropping the year, which makes day 60 ambiguous.
    • Using an ordinal number as elapsed days between dates.
    • Confusing a local calendar date with a timestamp that can change date across time zones.
    • Typing a locale-specific date string when the field expects a calendar-date value.
8

Frequently Asked Questions

Is January 1 day 0 or day 1?

It is day 1. This is a one-based calendar count, so the last day is 365 or 366.

What day number is February 29?

In a leap year, February 29 is day 60. March 1 then becomes day 61.

Why must the year be included?

Leap years shift every date after February by one ordinal position, so an ordinal number alone may not identify a month and day.

Is 2100 a leap year?

No. Century years are leap years only when divisible by 400; 2000 qualifies, but 2100 does not.

Does time zone affect the answer?

Not for a date entered as a civil calendar date. A timestamp can map to different local dates, but this form does not convert timestamps.

Can I find days remaining by subtracting from 365?

In an ordinary year, 365 minus the ordinal gives days after the selected date. Use 366 in a leap year and decide whether to include the selected date.

9

Sources & References