Date to Julian Day Converter
Convert between calendar dates and Julian Day Numbers used in astronomy and programming. Enter values for instant results with step-by-step formulas.
Reviewed for accuracy by Abdullah, Technical Content Specialist
Date to Julian Day Converter
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: JDN = day + โ(153m+2)/5โ + 365y + โy/4โ - โy/100โ + โy/400โ - 32045
Worked example โ JD = 2440423.345 | MJD = 40422.845 | Day of week: Sunday
Formula
JDN = day + โ(153m+2)/5โ + 365y + โy/4โ - โy/100โ + โy/400โ - 32045
The Julian Day Number is computed from the Gregorian calendar date by adjusting January and February as months 13-14 of the prior year, then applying the formula that accounts for leap years. The full Julian Day adds the time fraction (hour-12)/24.
Worked Examples
Example 1: Moon Landing Date to Julian Day
Problem:Convert the Apollo 11 Moon landing date, July 20, 1969, at 20:17 UT, to Julian Day.
Solution:Year = 1969, Month = 7, Day = 20, Hour = 20, Minute = 17 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 JDN = 2440423 JD = 2440423 + (20-12)/24 + 17/1440 = 2440423.345
Result:JD = 2440423.345 | MJD = 40422.845 | Day of week: Sunday
Example 2: Julian Day to Calendar Date
Problem:Convert Julian Day 2451545.0 (the J2000.0 standard epoch) back to a calendar date.
Solution:JD = 2451545.0 z = floor(2451545.0 + 0.5) = 2451545 alpha = floor((2451545 - 1867216.25)/36524.25) = 16 a = 2451545 + 1 + 16 - 4 = 2451558 b = 2451558 + 1524 = 2453082 c = floor((2453082-122.1)/365.25) = 6715 dd = floor(365.25*6715) = 2452888 e = floor((2453082-2452888)/30.6001) = 6 Day = 2453082 - 2452888 - floor(30.6001*6) = 11 โ adjusted = 1 Month = 6-1 = 5 โ adjusted = 1 Year = 6715-4716 = 1999 โ adjusted = 2000
Result:January 1, 2000 at 12:00 UT (noon) โ the J2000.0 epoch
Frequently Asked Questions
What is a Julian Day Number (JDN)?
The Julian Day Number is a continuous count of days that has been running since the beginning of the Julian Period on January 1, 4713 BC in the proleptic Julian calendar (November 24, 4714 BC in the Gregorian calendar). It was devised by Joseph Justus Scaliger in 1583 and named after his father Julius Caesar Scaliger, not after the Julian calendar. Astronomers use JDN because it provides a single continuous number for any date, eliminating complications from varying month lengths, leap years, and calendar reforms. The Julian Day starts at noon Universal Time, so JD 2451545.0 corresponds to January 1, 2000, at 12:00 UT (noon).
What is the difference between JD, JDN, and MJD?
Julian Day (JD) is the continuous count of days and fractions since the epoch, including the time of day as a decimal fraction. Julian Day Number (JDN) is the integer part only, representing the whole day count without any time fraction. Modified Julian Day (MJD) was introduced by the Smithsonian Astrophysical Observatory in 1957 to make the numbers smaller and easier to use; MJD = JD - 2400000.5, which shifts the epoch to November 17, 1858, at midnight (not noon). The MJD starts at midnight instead of noon, which is more convenient for civil timekeeping. The Truncated Julian Day (TJD) is yet another variant defined as JD - 2440000.5, starting from May 24, 1968.
Why do astronomers use Julian Days instead of regular dates?
Astronomers use Julian Days because they provide a uniform, continuous timescale that avoids all the complications of civil calendars. Regular calendars have variable month lengths (28-31 days), leap years, different calendar systems (Julian vs. Gregorian), and historical inconsistencies like the missing days when the Gregorian calendar was adopted in 1582. Calculating the number of days between two historical dates using regular calendars requires handling all these edge cases. With Julian Days, finding the interval between any two dates is simply a subtraction. Julian Days are also essential for astronomical ephemerides, satellite tracking, and coordinating observations across different time zones and locations worldwide.
How is the Julian Day calculated from a calendar date?
The conversion from a Gregorian calendar date to Julian Day Number uses an algorithm that accounts for the varying month lengths and leap year rules. The standard formula involves adjusting the year and month so that January and February are treated as months 13 and 14 of the previous year. The core formula is: JDN = day + floor((153*m+2)/5) + 365*y + floor(y/4) - floor(y/100) + floor(y/400) - 32045, where y and m are the adjusted year and month. To get the full Julian Day with time, add (hour-12)/24 + minute/1440 + second/86400. The subtraction of 12 hours accounts for the Julian Day starting at noon rather than midnight.
What are common uses of Julian Day Numbers in programming?
In programming, Julian Day Numbers serve several practical purposes. Database systems like SQLite and Oracle use Julian Days internally for date arithmetic because simple subtraction gives the exact number of days between dates. Many satellite tracking systems (TLE format) use Julian dates for orbital element epochs. Financial applications use Julian dates for calculating day-count fractions in bond pricing. Scientific data logging often stores timestamps as Julian Days for precision and unambiguity. The Unix timestamp (seconds since January 1, 1970) can be converted to JD by the formula: JD = unix_seconds/86400 + 2440587.5. Julian Days are also used in GPS systems, where the GPS epoch (January 6, 1980) corresponds to JD 2444244.5.
References
Background & Theory
History
Reviewed for accuracy by Abdullah, Technical Content Specialist ยท Editorial policy
Related Calculators
๐งฎDate to Day Number Calculator
Convert any date to its ordinal day number within the year (1-366).
๐งฎDay Number Calculator
Find the day number (1-366) of any date within its year.
๐งฎChinese Calendar Converter
Convert between Gregorian calendar dates and the Chinese lunar calendar.
๐งฎHebrew Calendar Converter
Convert between Gregorian and Hebrew calendar dates with Jewish holiday awareness.
๐งฎPersian Calendar Converter
Convert between Gregorian, Hijri, and the Persian Solar Hijri (Jalali) calendar.
๐งฎDecimal Hours Converter
Convert between hours:minutes format and decimal hours for payroll and billing.
๐งฎElection Day Calculator
Find the date of US Election Day for any year using the first Tuesday after the first Monday rule.
๐งฎ24 Hour to 12 Hour Converter
Convert any 24-hour (military) time to 12-hour AM/PM format and vice versa.