Understanding the Julian date and MJD calculator — concept and principle
The Julian Date (JD) is a continuous count of days, including fractions, since noon Universal Time on 1 January 4713 BC in the proleptic Julian calendar. Subtracting two JDs gives the exact interval between events, with no months or leap years to worry about. The calculator also gives the Modified Julian Date (MJD) and Greenwich mean sidereal time (GMST).
How it is calculated
The calculator uses the algorithm in Jean Meeus, Astronomical Algorithms, for Gregorian dates:
- If the month is January or February, treat it as month 13 or 14 of the previous year.
- A = floor(Y / 100) and B = 2 − A + floor(A / 4) (the Gregorian leap-year correction).
- JD = floor(365.25 × (Y + 4716)) + floor(30.6001 × (M + 1)) + D + B − 1524.5 + hour / 24.
Then MJD = JD − 2,400,000.5, and GMST (hours) = 18.697374558 + 24.06570982441908 × (JD − 2,451,545), reduced to 0–24 h. The hour must be in UTC.
The principle
Moving January and February to the end of the year puts the leap day last, so 30.6001 × (M + 1) can reproduce the cumulative month lengths, and 365.25 counts Julian years with leap days. B removes the century leap days that the Gregorian calendar skips. JD days begin at noon, so midnight dates end in .5. MJD starts days at midnight with shorter numbers; MJD 0 is 17 November 1858, 0h UTC. Sidereal time measures Earth's rotation against the stars rather than the Sun; a sidereal day is about 3 min 56 s shorter than a solar day. JD 2,451,545.0 is the J2000.0 epoch (1 January 2000, 12h).
Worked example
- Inputs: 8 November 2026, 12:00 UTC. Month 11 is after February, so Y = 2026, M = 11.
- A = 20, B = 2 − 20 + 5 = −13.
- floor(365.25 × 6742) = 2,462,515 and floor(30.6001 × 12) = 367.
- JD = 2,462,515 + 367 + 8 − 13 − 1524.5 + 0.5 = 2,461,353.
- MJD = 2,461,353 − 2,400,000.5 = 61,352.5.
- Days since J2000.0 = 9,808, so GMST = 18.697374558 + 24.06570982441908 × 9,808 mod 24 = 15.17933246 h (about 15 h 10 m 46 s).
| Year | Julian Date |
|---|---|
| 506 | 1,906,367 |
| 1,013 | 2,091,362 |
| 1,520 | 2,276,357 |
| 2,026 | 2,461,353 |
| 2,532 | 2,646,348 |
| 3,039 | 2,831,343 |
| 4,052 | 3,201,335 |
How to read the result
A whole JD means noon UTC; .5 means midnight. Differences between JDs are elapsed days, so 0.25 is six hours. GMST tells you which right ascension is on the Greenwich meridian; add your east longitude ÷ 15 to get local sidereal time.
Common mistakes
- Entering local time instead of UTC; in Korea subtract 9 hours first.
- Expecting midnight to give a whole number; JD days start at noon.
- Using the formula for dates before the Gregorian reform of 1582, where the B correction does not apply.
Frequently asked questions
What is the difference between a Julian Date and a "Julian date" on food packaging?
Packaging and military "Julian dates" usually mean the day of the year (1–366). That is a different system from the astronomical JD.
Why is MJD used in satellite and observatory data?
It keeps numbers smaller and starts each day at midnight, which suits civil time stamps.
Sources: J. Meeus, Astronomical Algorithms, 2nd ed., Willmann-Bell, 1998, Chapter 7 · U.S. Naval Observatory, Computing Greenwich Apparent Sidereal Time (approximate formulas)