Time & Dates
Julian day number (Days Between Dates)
Converts a calendar date into a continuous day count, where a equals floor((14 minus month) divided by 12), y equals year plus 4800 minus a, and m equals month plus 12a minus 3.
Last updated
The Formula
JDN = d + floor((153m + 2) / 5) + 365y + floor(y/4) - floor(y/100) + floor(y/400) - 32045
Converts a calendar date into a continuous day count, where a equals floor((14 minus month) divided by 12), y equals year plus 4800 minus a, and m equals month plus 12a minus 3.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| d | Day of the month | day | The day number within the month. |
| m | Shifted month | month | Month plus twelve times a, minus three. |
| y | Shifted year | year | Year plus 4800 minus a. |
What Each Symbol Means
dday
Day of the month
The day number within the month.
mmonth
Shifted month
Month plus twelve times a, minus three.
yyear
Shifted year
Year plus 4800 minus a.
See It Worked With Real Numbers
A formula on its own does not tell you which number goes where. The how to calculate days between dates page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.
Where This Formula Appears
This equation is the working core of How To Calculate Days Between Dates, filed under Everyday Life. Every number the guide produces comes from substituting into this one line.
Common Questions
What is the formula for Julian day number (Days Between Dates)?
The formula for Julian day number (Days Between Dates) is JDN = d + floor((153m + 2) / 5) + 365y + floor(y/4) - floor(y/100) + floor(y/400) - 32045. Converts a calendar date into a continuous day count, where a equals floor((14 minus month) divided by 12), y equals year plus 4800 minus a, and m equals month plus 12a minus 3.
What does each symbol in Julian day number (Days Between Dates) stand for?
d is day of the month; m is shifted month; y is shifted year.
What units should I use with Julian day number (Days Between Dates)?
Substitute d in day, m in month, y in year. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.
What is a common mistake when using Julian day number (Days Between Dates)?
Assuming every month has thirty days. Months run from twenty-eight to thirty-one days. A thirty-day approximation drifts by several days over a year and is wrong for anything contractual.