Overview
Introduction
Astronomers and some scientific software don't work with calendar dates directly, they use a single continuous day count called the Julian Day Number, which sidesteps the irregular lengths of months and years entirely.
This tool converts a normal Gregorian calendar date into its Julian Day Number using the standard Fliegel and Van Flandern algorithm.
What Is Convert a Date to a Julian Day?
A date-to-Julian-Day-Number converter, taking a Gregorian calendar date and returning the integer count of days since the start of the Julian Period on January 1, 4713 BCE.
Despite the shared name, this is unrelated to the historical Julian calendar; it's a continuous numbering system, not a set of months and years, named after Julius Scaliger's father rather than Julius Caesar's calendar reform.
How Convert a Date to a Julian Day Works
The input date is validated as a real Gregorian calendar date, month by month and with proper leap year handling for February.
The Fliegel and Van Flandern algorithm then computes the Julian Day Number directly from the year, month, and day using integer arithmetic, without going through JavaScript's Date object.
When To Use Convert a Date to a Julian Day
Use it when working with astronomical calculations, ephemeris data, or older scientific software that expects a Julian Day Number instead of a calendar date.
It's also handy for date-difference math, since subtracting two Julian Day Numbers gives the exact number of days between them without manual calendar arithmetic.
Features
Advantages
- Uses the well-established Fliegel and Van Flandern algorithm, the standard approach for this conversion.
- Works across a very wide range of calendar dates without relying on JavaScript's Date object and its platform-dependent range limits.
- Returns a plain integer ready to paste into scientific or astronomical software.
Limitations
- Only accepts Gregorian calendar input dates; for a Julian calendar date, convert it to Gregorian first with Convert Julian Calendar to Gregorian Calendar.
- Returns the integer Julian Day Number for the date at noon, it does not include a fractional time-of-day component.
Examples
Best Practices & Notes
Best Practices
- Use Convert a Julian Day to a Date to reverse the conversion and double-check a result.
- Remember the returned number represents the day itself, not a specific moment within it, if you need sub-day precision, track the fractional day separately.
Developer Notes
This tool shares its core algorithm with julian-day-math.ts's `gregorianToJulianDayNumber` function, the Fliegel and Van Flandern formula, which is also reused by the Julian and Gregorian calendar converters in this category to move between calendar dates via a common Julian Day Number.
Convert a Date to a Julian Day Use Cases
- Feeding a calendar date into astronomical or ephemeris software that expects a Julian Day Number
- Computing the exact number of days between two dates by subtracting their Julian Day Numbers
- Cross-referencing historical or scientific records that cite dates as Julian Day Numbers
Common Mistakes
- Assuming this is a Julian calendar conversion, it isn't, the Julian Day Number is a separate continuous count unrelated to the Julian calendar's months and years.
- Entering a Julian calendar date instead of a Gregorian one, which produces the wrong Julian Day Number since this converter assumes Gregorian input.
Tips
- Subtract two Julian Day Numbers from this tool to get an exact day count between two dates.
- Use Convert a Julian Day to a Date afterward to confirm your Julian Day Number converts back to the expected date.