Converts a proleptic Gregorian civil date to its Julian Day Number (JDN).
Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.
Try it
Inputs
date (string, required) : ISO 8601 date, YYYY-MM-DD
Outputs
jdn: Julian Day Number, an integer day count with no calendar gaps
Steps
Parse the date as a proleptic Gregorian civil date.
Convert it to a day-number using Hinnant's days_from_civil algorithm, which is arithmetically equivalent to the Fliegel and Van Flandern (1968) integer JDN formula.
Add 2440588 (the JDN of 1970-01-01, the algorithm's epoch) to obtain the Julian Day Number.
A Machine Algorithm for Processing Calendar Dates (Fliegel, H. F.; Van Flandern, T. C., Communications of the ACM 11(10):657 (1968), 2026-09-30T19:41:35Z) - the original integer civil-date-to-JDN algorithm this method is arithmetically equivalent to