Day of Year Calculator
Find the day number of the year (1-366) for any date. Convert between ordinal dates and calendar dates. Handles leap years automatically.
Built by Michael Lip
Frequently Asked Questions
What is the day of year?
The day of year (also called ordinal date) is the number of days since January 1. January 1 is day 1, February 1 is day 32, and December 31 is day 365 (or 366 in a leap year). The ISO 8601 ordinal date format is YYYY-DDD (e.g., 2026-100 for April 10).
How do I calculate day of year?
Sum the days in each preceding month plus the current day of the month. For April 10: 31 (Jan) + 28 (Feb) + 31 (Mar) + 10 = 100. In a leap year, add 1 after February. In JavaScript: Math.floor((date - new Date(date.getFullYear(), 0, 0)) / 86400000).
What is the difference between ordinal date and Julian day?
Ordinal date is the day number within a year (1-366). Julian Day Number (JDN) is a continuous count of days since November 24, 4714 BC. They are completely different systems. The ordinal date resets every January 1; the Julian Day Number never resets.
Where are ordinal dates used?
Ordinal dates are used in astronomy, military date-time groups, satellite tracking (TLE format), agriculture, insurance, and any context where a compact date representation is needed. Python's datetime.timetuple().tm_yday returns the ordinal date.
Is this tool free?
Yes. All EpochPilot tools are free, run in your browser, and require no signup or account.
How It Works
This calculator determines the ordinal date by computing the difference in days between the input date and January 0 (December 31 of the previous year) of the same year. It correctly handles leap years using the standard rule: divisible by 4, except centuries, unless also divisible by 400.
Ordinal dates appear in many data formats. Satellite Two-Line Element (TLE) sets use ordinal dates for the epoch. Military Date-Time Groups (DTG) sometimes reference day of year. In data science, ordinal dates are useful for seasonal analysis since they provide a linear day count unaffected by month boundaries.
Related Tools
Privacy
Everything runs locally in your browser. No data is transmitted to any server. Source code is open on GitHub.
Contact
EpochPilot is built by Michael Lip. Email [email protected] for feedback.