Explanation of Julian Day Number Calculation
This web page provides a brief explanation for
how the Julian Day Number (JDN) is calculated in Project 1.
-
The expression for a:
will result in a 1 for January (month 1) and February (month 2).
The result is 0 for the other 10 months.
-
The expression for y:
y = year + 4800 – a
adds 4800 to the year so that we will start counting years from
the year –4800. [As a side note, year 1
corresponds to 1 CE, year 0 corresponds to 1 BCE, year
–1 corresponds to 2 BCE, and so on. There is no year between
1 CE and 1 BCE.]
The – a part of the expression subtracts one if the month is
January or February and goes along with the next part of the
calculation.
-
The expression for m:
m = month + 12a – 3
results in a 10 for January, 11 for February, 0 for March, 1 for
April, ..., and a 9 for December. This is because a is 1
for January and February and 0 for the other months. The effect
of the combined calculation of y and m is to pretend
that the year begins in March and ends in February.
-
The expression for JDN:
|
153m + 2 |
|
y |
|
y |
|
y |
|
JDN = day + |
|
+ 365y + |
|
– |
|
+ |
|
– 32045 |
|
5 |
|
4 |
|
100 |
|
400 |
|
has several parts to it. Remember that we are calculating the
number of days since a fixed day in the past, and there are several things
to take into account.
-
Adding day (the day of the month) should be easy to figure out.
Each increment to day increments the number of days since a
fixed day.
-
The integer division (153m + 2)/5 is a cleverly designed
expression to calculate the number of days in the previous months
(where March corresponds to m=0). So for example, June
corresponds to a value of 3 for m. For this value of
m, the expression results in a value of 461/5 = 92 using
integer division, which are the total number of days in March, April,
and May.
-
The expression 365y should be easy to figure out, i.e., each
non-leap-year has 365 days.
-
The expression y/4 - y/100 + y/400 (all integer divisions)
calculates the number of leap years since the year
–4800 (which corresponds to a value of 0 for y).
Recall that there is a leap year every year that is divisible by 4,
except for years that are divisible by 100, but not divisible by
400. The number of leap years is, of course, the same as the
number of leap days that need to be added in.
-
The last part – 32045 ensures that the result will be
0 for January 1, 4713 BCE.