# Julian day and Julian day number

The Julian day number is an aid to simplify calculations with calendar dates. You need the Julian day number for several calculations. For instance sidereal time, planetary positions and the angle between equator and ecliptic.

Julian is not named after the Julian Calendar but after Julius Scaliger (see Duncan).

The day number is always for 12:00 noon. For real calculations you also use the actual time, measured in UT. This results in the Julian Day.

The principle is straightforward. Start counting in the year -4712 at Januari 1 at 12:00 noon. Then count the days. This way, each day will get a number. For the first day 0, then 1, 2 etc.

### Formula

(After Meeus)

For input you need a calendar date and time. You need to know if the Julian or the Gregorian calendar is in use. The time needs to be in UT.

For calendar dates in the Common Era you can use the astronomical years. Before the Common Era you need to use the astronomical years. See Counting the years: historical and astronomical

Define the following values:

• Y the year from the given calendar date
• M the month: 1 for January etc. until 12 for December
• D the day
• If M < 3 (so for the months January and February) you replace Y with Y – 1 and M with M + 12
• Calculate A = int ( Y / 100)
• Calculate B
• For the Gregorian calendar: B = 2 – A + int (A / 4)
• For the Julian calendar: B = 0
• Calculate TIME as the percentage of the day:
• define hours, minutes and seconds using fractions:
• TIME = (hours + minutes/60 + seconds/3600) / 24
• Calculate the Julian Day JD :
• JD = int (365.25(Y + 4716)) + int(30.6001(M + 1)) + D + B – 1524.5 + TIME

### Example

November 2, 2016 (Gregorian calender) 21:17:30 UT

• Y = 2016
• M = 11
• D = 2
• M is larger than 3 so you do not need to apply a correction for M and Y.
• A = int (Y / 100) = int (2016/100) = 20
• You use the Gregorian calendar:
• B = 2 – A + int (A / 4) = 2 – 20 + int(20 / 4) = 2 – 20 + 5 = -13
• TIME = (21 + 17/60 + 30/3600) / 24 = (21 + 0.283333333 + 0.008333333) / 24 = 21.291666666 / 24 = 0.887152778
• JD = int (365.25 (Y + 4716)) + int(30.6001(M + 1)) + D + B – 1524.5 + TIME = int (365.25 (2016 + 4716)) + int(30.6001(11 + 1)) + 2 – 13 – 1524.5 + 0.887152778 = 2458863 + 367 + 2 – 13 – 1524.5 + 0.387152778 = 2457695.387152778

### References

• Duncan, David Ewing: The Calendar. New York, 1998.
• Meeus, Jean: Astronomical Algorithms. Second edition. Richmond, Virginia, 1998.