How to compute the Julian Day Number from a date
Compute Julian Day Number JDN MJD J2000.0 from Gregorian or Julian date. Scaliger 1583 formula: JDN = D + floor((153m+2)/5) + 365y + floor(y/4) - floor(y/100) + floor(y/400) - 32045. Astronomy ephemeris NASA JPL ESA orbital mechanics.
Report a calculation error
Help us improve. Describe what is wrong with the calculation.
Result
| Voce | Valore |
|---|
Show full details
Share result
Disclaimer: this calculation is for informational purposes only. For important decisions, consult a qualified professional.
How to compute the Julian Day Number (JDN): continuous count of days elapsed since the epoch January 1, 4713 BC noon Universal Time (proleptic Julian calendar), invented by Joseph Justus Scaliger (France-Holland 1540-1609) Leiden 1583 in "De Emendatione Temporum" as tool for historical chronology eliminating calendar ambiguities. JDN Gregorian formula: JDN = D + floor((153m+2)/5) + 365y + floor(y/4) - floor(y/100) + floor(y/400) - 32045, with a=floor((14-M)/12), y=Y+4800-a, m=M+12a-3, where Y year (e.g. 2026), M month (1-12), D day (1-31). Example: January 1, 2000 12:00 UT = JDN 2451545 = J2000.0 astronomical standard epoch. Julian Date (JD) includes day fraction: JD = JDN + (H-12)/24 + Min/1440 + Sec/86400. Modern variants: Modified Julian Date MJD = JD - 2400000.5 (epoch November 17, 1858 00:00 UT, NASA satellite standard), Truncated Julian Date TJD = JD - 2440000.5 (May 24, 1968), Reduced Julian Date RJD = JD - 2400000, Lilian Date = JD - 2299159.5 (epoch October 15, 1582 Gregorian calendar). For Julian calendar (pre-1582): JDN_julian = D + floor((153m+2)/5) + 365y + floor(y/4) - 32083.
Essential tools for: astronomy satellite observations orbital mechanics (USNO US Naval Observatory Washington DC, NRAO National Radio Astronomy Observatory Charlottesville VA, Lowell Observatory Flagstaff AZ Pluto discovery 1930, McDonald Observatory Texas), space missions (NASA JPL Jet Propulsion Laboratory Pasadena CA USA, JSC Johnson Space Center Houston TX, KSC Kennedy Space Center FL, ESA Paris-ESOC Darmstadt Germany), JPL DE440 ephemeris standard planetary position tables, religious calendar conversion (Vatican Easter Council Nicaea 325 AD, Hebrew calendar lunisolar Pesach Yom Kippur, Islamic Hijri lunar Mecca observation), GPS time TAI International Atomic Time epoch January 6, 1980 0:00 UTC, Unix timestamp (JD - 2440587.5) * 86400 epoch January 1, 1970 UTC.
Julian Day Number formulas
JDN Gregorian (post-October 15, 1582): a = floor((14 - M) / 12); y = Y + 4800 - a; m = M + 12a - 3; JDN = D + floor((153m + 2)/5) + 365y + floor(y/4) - floor(y/100) + floor(y/400) - 32045. Convention: January-February considered as months 13-14 of previous year (a=1 January-February, a=0 March-December). Result JDN pure integer, valid proleptic Gregorian backward to 4713 BC noon (JDN=0 origin epoch).
JDN Julian (pre-October 4, 1582): a = floor((14 - M) / 12); y = Y + 4800 - a; m = M + 12a - 3; JDN = D + floor((153m + 2)/5) + 365y + floor(y/4) - 32083. Difference vs Gregorian: omit centennial correction floor(y/100) - floor(y/400) and constant shift. Calendar transition skip 10 days October 4, 1582 (Julian) -> October 15, 1582 (Gregorian) Bolla Inter Gravissimas Pope Gregory XIII Vatican.
Julian Date fraction: JD = JDN + (Hour - 12) / 24 + Minute / 1440 + Second / 86400. Historical convention: astronomical day starts at noon UT 12:00 (instead of civil midnight) for night-observation convenience (entire night within same JD day). JD 2451545.0 = January 1, 2000 12:00 TT epoch J2000.0 international astronomy standard.
Modified Julian Date (MJD): MJD = JD - 2400000.5. Conventional epoch November 17, 1858 00:00 UT. Advantage: smaller number (5 digits for modern dates), starts at civil midnight (no 0.5 day offset). NASA standard for space missions, geodesy IERS International Earth Rotation Service Frankfurt Germany, satellite telecommunications orbital. ITU International Telecommunication Union Geneva Switzerland MJD adopted 1957.
Unix timestamp conversion: Unix_seconds = (JD - 2440587.5) * 86400. Unix epoch January 1, 1970 00:00 UTC = JD 2440587.5. POSIX C library time_t int64 seconds. Year 2038 problem: 32-bit Unix overflow January 19, 2038 03:14:07 UTC. Languages support: C struct timespec, Java Instant, Python datetime.timestamp(), JavaScript Date.now()/1000.
History and context
Joseph Justus Scaliger (France-Holland 1540-1609) Leiden University 1583 invented Julian Day Number in treatise "De Emendatione Temporum" (On the Emendation of Time) as tool for historical chronology unifying datings across calendars. Name "Julian" not from Julius Caesar 46 BC calendar reform, but from father Julius Caesar Scaliger French humanist 1484-1558 (classical philologist). Epoch chosen January 1, 4713 BC noon UT proleptic Julian: combination astronomical-religious cycles: 28-year solar cycle (days of week repeat), 19-year Metonic lunar cycle (Easter calculation), 15-year Roman indiction (Byzantine tax cycle). LCM(28, 19, 15) = 7980 years Julian Period. Year 4713 BC = year 1 of cycle (1582 + 4713 - 1 = year 6294 of period). Friedrich Wilhelm Bessel (Germany 1784-1846) Königsberg astronomer 1830 founded besselian year B1900.0, B1950.0 (JD 2433282.4235) astronomy standard pre-J2000.0 stellar coordinates equinox precession. Simon Newcomb (Canada-USA 1835-1909) US Naval Observatory Washington DC founded 1830 ephemeris standard Newcomb Tables Sun Moon planets. Marquis de Laplace Pierre-Simon (France 1749-1827) Mécanique Céleste 5 volumes 1799-1825 base modern orbital mechanics. Albert Einstein (Germany-USA 1879-1955) Princeton 1916 General Relativity TT Terrestrial Time relativistic correction TAI International Atomic Time. NASA JPL Jet Propulsion Laboratory Pasadena CA USA founded 1936 Caltech founder von Kármán pioneer rocketry;
DE440 ephemeris release 2020 high-precision planetary positions, satellites GPS Iridium NOAA. ESA European Space Agency Paris founded 1975 ESOC Darmstadt Germany operations center, missions Rosetta Philae comet Tchurioumov 2014, Mars Express, ExoMars 2026 Trace Gas Orbiter, Galileo GPS European 2016+ 30 satellites precision time MJD reference. USA: USNO US Naval Observatory Washington DC founded 1830 master clock rubidium-cesium atomic, NIST Boulder CO precision time standards Federal NIST-F1 fountain cesium clock 10^-15 accuracy, JPL Pasadena CA. NRAO National Radio Astronomy Observatory Charlottesville VA Green Bank WV 100m telescope, VLA Very Large Array New Mexico 27 antennas. Lowell Observatory Flagstaff AZ Clyde Tombaugh discovered Pluto 1930. Mauna Kea Hawaii 4200m altitude Subaru Keck Gemini telescopes. Caltech Pasadena CA. STScI Space Telescope Science Institute Baltimore MD Hubble JWST operations. JWST James Webb Space Telescope launch December 25, 2021 NASA-ESA-CSA infrared 6.5m mirror Sun-Earth L2 Lagrange point. Hubble Space Telescope 1990 launch 2.4m mirror servicing missions 5 STS Shuttle. Religious calendars conversion: Vatican Rome Easter Sunday Council Nicaea 325 AD calculation Gauss algorithm 1800; Hebrew calendar Israel Tel Aviv lunisolar Pesach 14 Nisan Yom Kippur 10 Tishri Jewish High Holidays USA 7.5 mln Jews ADL American Jewish Committee NY;
Islamic Hijri lunar Saudi Arabia Mecca observation Riyadh Supreme Court official decision USA 3.5 mln Muslims Mosques NYC Washington DC. JD utility comparing dates across calendars unified time scale. Astronomical software programming: PyEphem Python library Brandon Rhodes 2008+, Astropy Python NumPy collaboration 2011+ NSF NASA grant, NOVAS US Naval Observatory C library, JPL Horizons online ephemeris service free public NASA. USA research: NIST Boulder CO atomic clocks Federal time signal WWV WWVH WWVB 60 kHz Fort Collins CO, GPS time NAVSTAR USAF Schriever AFB Colorado Springs. Universities USA: Princeton NJ, MIT Cambridge MA, Caltech Pasadena CA, Stanford Palo Alto CA, Berkeley CA, Cornell Ithaca NY, Carnegie Mellon Pittsburgh PA, Harvard Cambridge MA, Yale New Haven CT, University of Texas Austin McDonald Observatory.
JD epochs and reference dates table
- JD 0.0: January 1, 4713 BC 12:00 UT proleptic Julian (Scaliger origin epoch)
- JD 1721423.5: January 1, 1 AD 00:00 UT (Christian era start)
- JD 2299160.5: October 15, 1582 00:00 UT (Gregorian transition)
- JD 2299161.0: October 15, 1582 12:00 UT (Lilian Date 1.0)
- JD 2400000.5: November 17, 1858 00:00 UT (MJD epoch)
- JD 2415020.5: January 1, 1900 00:00 UT
- JD 2415020.3135: B1900.0 besselian epoch
- JD 2433282.4235: B1950.0 besselian epoch standard pre-J2000
- JD 2440000.5: May 24, 1968 00:00 UT (TJD epoch)
- JD 2440587.5: January 1, 1970 00:00 UTC (Unix epoch)
- JD 2444239.5: January 6, 1980 00:00 UTC (GPS time epoch)
- JD 2451544.5: January 1, 2000 00:00 UT
- JD 2451545.0: January 1, 2000 12:00 TT (J2000.0 astronomical standard)
- JD 2461042.0: January 1, 2026 12:00 UT
- Year 2038 problem: January 19, 2038 03:14:07 UTC = JD 2465442.6347 (Unix overflow 32-bit)
- Calendar reform: Italy Spain Portugal France 1582; UK 1752; Russia 1918; Greece 1923
- Gregorian leap year: Y%4==0 AND (Y%100!=0 OR Y%400==0)
- Julian leap year: Y%4==0 every 4 years simple
- Julian Period: 7980 years (28 solar * 19 lunar * 15 indiction)
- JDN integer: changes at noon UT, JD fraction includes hour-minute-second
- Unix timestamp 0: JD 2440587.5 = January 1, 1970 00:00 UTC
- NTP timestamp 0: JD 2415020.5 = January 1, 1900 00:00 UT
- FAT timestamp 0: JD 2444239.5 = January 1, 1980 00:00 UTC
- Apple HFS+: epoch January 1, 1904 00:00 UT
- VMS DEC: epoch November 17, 1858 00:00 UT (MJD same)
- Excel serial date: epoch December 30, 1899 (day 1 = December 31, 1899)
Detailed numerical examples
Example 1 - J2000.0 astronomical standard epoch. Date January 1, 2000 12:00 TT. Gregorian calendar. Calculation: a=floor((14-1)/12)=1, y=2000+4800-1=6799, m=1+12-3=10. JDN=1+floor((153*10+2)/5)+365*6799+floor(6799/4)-floor(6799/100)+floor(6799/400)-32045 = 1+306+2481635+1699-67+16-32045 = 2451545. JD=2451545+0=2451545.0 (noon offset zero). MJD=2451545.0-2400000.5=51544.5. Days from J2000=0. Day of week Saturday. Astronomical standard International Astronomical Union IAU adopted 1976 replacing B1950.0 besselian. Reference frame ICRS International Celestial Reference System.
Example 2 - Today April 30, 2026 12:00 UT. Date April 30, 2026 12:00 UT. Gregorian calendar. a=floor((14-4)/12)=0, y=2026+4800-0=6826, m=4+0-3=1. JDN=30+floor((153*1+2)/5)+365*6826+floor(6826/4)-floor(6826/100)+floor(6826/400)-32045 = 30+31+2491490+1706-68+17-32045 = 2461161. JD=2461161.0. MJD=60660.5. Days from J2000=9616.0 (~26.3 years post-J2000). Unix timestamp = (2461161.0-2440587.5)*86400 = 1777824000. Day of week Thursday. USA: April 30 spring full season retail stocks NYSE opening Q1 earnings reports.
Example 3 - Apollo 11 lunar landing July 20, 1969 20:17:40 UT. Date July 20, 1969 20:17:40 UT (Mare Tranquillitatis Lunar Module Eagle Neil Armstrong Buzz Aldrin). Gregorian. a=floor((14-7)/12)=0, y=1969+4800-0=6769, m=7+0-3=4. JDN=20+floor((153*4+2)/5)+365*6769+floor(6769/4)-floor(6769/100)+floor(6769/400)-32045 = 20+122+2470685+1692-67+16-32045 = 2440423. JD=2440423+(20.2944-12)/24=2440423+0.3456=2440423.3456. MJD=39922.8456. Days from J2000=-11121.65 (~30.5 years pre-J2000). Unix timestamp = (2440423.3456-2440587.5)*86400 = -14182521.6 seconds. Day of week Sunday. NASA Mission Control Houston TX MSC Manned Spacecraft Center, Walter Cronkite CBS coverage 530 mln viewers worldwide.
Example 4 - Calendar transition October 15, 1582 (Gregorian start). Date October 15, 1582 00:00 UT Gregorian calendar (first day). a=floor((14-10)/12)=0, y=1582+4800-0=6382, m=10+0-3=7. JDN_gregorian=15+floor((153*7+2)/5)+365*6382+floor(6382/4)-floor(6382/100)+floor(6382/400)-32045 = 15+226+2329430+1595-63+15-32045 = 2299173. JD=2299173-0.5=2299172.5 midnight. Lilian Date = 2299172.5 - 2299159.5 = 13.0 (day 13 Gregorian era). Bolla "Inter Gravissimas" Pope Gregory XIII Boncompagni February 1582 Vatican Rome. Italy Spain Portugal France adopted October 1582 skipping 4-15 October, UK 1752, Russia 1918, Greece 1923.
Example 5 - Unix epoch January 1, 1970 00:00 UTC. Date January 1, 1970 00:00 UTC POSIX C library time_t base. Gregorian. a=floor((14-1)/12)=1, y=1970+4800-1=6769, m=1+12-3=10. JDN=1+floor((153*10+2)/5)+365*6769+floor(6769/4)-floor(6769/100)+floor(6769/400)-32045 = 1+306+2470685+1692-67+16-32045 = 2440588. JD=2440588-0.5=2440587.5 midnight. MJD=40587.0. Unix timestamp=0 by definition. Day of week Thursday. AT&T Bell Labs Murray Hill NJ USA Ken Thompson Dennis Ritchie 1969-1971 Unix development, time_t int32 problem 2038 mitigated Linux 5.6+ int64 64-bit time_t.
Limits and considerations
- Origin epoch January 1, 4713 BC noon: pre-date events impossible to calculate without proleptic backward extrapolation Julian calendar; Julian Period 7980 years exhausts 3267 AD recurs.
- Calendar transition gap October 5-14, 1582: dates non-existent in real history (Italy adopted), software should handle as error or allow proleptic extrapolation.
- Astronomical convention day starts at noon UT vs civil midnight: 12-hour offset, frequent cause Unix timestamp conversion errors.
- Time scale: UT1 universal Earth rotational, UTC coordinated atomic with leap seconds, TAI atomic continuous, TT terrestrial barycentric. JD definition usually UT or TT context dependent.
- Year 0 controversy: astronomical convention includes year 0 (1 BC = year 0), historical convention skips (1 BC -> 1 AD). JDN proleptic uses astronomical (continuous).
- Leap seconds: UTC vs TAI offset increasing 37 s as 2024, JD continuous TT/TAI but UTC discontinuous. Critical satellite navigation GPS time.
- Float precision JD: double precision 15-17 significant digits = 0.001 second precision year 2000 epoch; quad precision required sub-millisecond high-precision astronomy.
- Far-past dates pre-4713 BC: requires negative JD or Julian Period predecessor; software libraries often limited proleptic +/- 4000 years.
- Calendar systems beyond Gregorian/Julian: Hebrew lunisolar, Islamic Hijri lunar, Chinese lunisolar, Persian Jalali require separate algorithms not Zeller-style integer division.
- Time zones: JD inherently UT/UTC zero-meridian Greenwich, local time conversion required for civilian applications.
Common errors
- Confusing JDN integer with JD fractional: JDN changes at noon UT, JD includes hours.
- Neglecting 0.5 offset civil midnight: Unix epoch 1970-01-01 00:00 = JD 2440587.5 NOT 2440588.
- Calculating JD for dates October 5-14, 1582: not exist Gregorian, software should error or use Julian.
- Mixing time scales UT vs UTC vs TT vs TAI: differences up to 70 seconds for modern epochs.
- Neglecting leap seconds in UTC-TAI conversions: 37 seconds as 2024, growing.
- Wrong month 13-14 convention: January-February must be shift Y-1 with a=1.
- Float double precision insufficient: nano-second precision cripples JD near J2000 epoch.
- Year 0 controversy: historical (no year 0) vs astronomical (year 0 = 1 BC), JDN uses astronomical.
- Pre-Gregorian dates pretending Gregorian: must use proleptic Gregorian formula or Julian.
- Neglecting calendar adoption per country: Russia 1918 dates pre-1918 were Julian official, post-1918 Gregorian.
Numbered applications
- USA astronomical observation: USNO Washington DC master clock, NRAO Charlottesville VA Green Bank WV 100m telescope, Lowell Observatory Flagstaff AZ Pluto discovery 1930, McDonald Observatory Texas.
- NASA space missions: JPL Pasadena CA DE440 ephemeris, JSC Houston TX, KSC FL, Apollo Mercury Gemini Shuttle ISS programs.
- European astronomy ESA: Paris-ESOC Darmstadt Germany, Rosetta Philae comet 2014, ExoMars 2026, Galileo GPS European 30 satellites.
- JPL DE440 ephemeris: NASA Jet Propulsion Laboratory Pasadena CA USA, planetary positions standard, satellites GPS Iridium NOAA.
- Religious calendar conversion: Vatican Easter Council Nicaea 325 AD, Hebrew lunisolar USA 7.5 mln Jews ADL NY, Islamic Hijri USA 3.5 mln Muslims.
- GPS time TAI: epoch January 6, 1980 0:00 UTC, satellite navigation, USAF Schriever AFB Colorado Springs NAVSTAR.
- Unix timestamp programming: POSIX C library time_t, Java Instant, Python datetime.timestamp(), JavaScript Date.now()/1000.
- Geodesy IERS: International Earth Rotation Service Frankfurt Germany, MJD standard rotation Earth UT1-UTC.
- Astronomical software: PyEphem Brandon Rhodes 2008, Astropy NumPy collaboration 2011, NOVAS US Naval Observatory C library, JPL Horizons free public.
- Educational research: Princeton MIT Caltech Stanford Berkeley Cornell Carnegie Mellon Harvard Yale University Texas Austin astronomy departments.
For support
For technical questions or reports: info@calcoi.com. Educational astronomical chronology tool. For professional applications Scaliger JJ 1583 'De Emendatione Temporum', Newcomb S 1898 'Tables of the Motion of the Earth', Seidelmann PK 'Explanatory Supplement to the Astronomical Almanac' US Naval Observatory 3rd edition 2013, ISO 8601:2019 Date and Time Format, IAU International Astronomical Union resolutions J2000.0 1976.
Updated July 2026
Comments (0)
Login to leave a comment.
No comments yet. Be the first!