Time & Calendar
Intermediate

Ordinal Day of Year

Day-of-year number (1–366) for a given date.

Formula

N=275M9kM+912+D30N = \left\lfloor \dfrac{275M}{9} \right\rfloor - k\left\lfloor \dfrac{M+9}{12} \right\rfloor + D - 30

Variables

MMonth
DDay
k1 if leap year else 2

Example

March 1 in a leap year ⇒ N = 61

Did You Know?

Ordinal dates (e.g. 2024-061) appear on aviation and manufacturing labels where a compact date is handy.