Celestine API Documentation - v0.2.0
    Preparing search index...

    Function toJulianDate

    • Convert a calendar date/time to Julian Date

      Uses the Meeus algorithm which handles both Gregorian (post-1582) and Julian (pre-1582) calendar dates automatically.

      The calendar reform occurred on October 15, 1582 (Gregorian), which was October 4, 1582 (Julian). Days October 5-14, 1582 don't exist in the Gregorian calendar.

      Parameters

      Returns number

      Julian Date (fractional days since JD epoch)

      "Astronomical Algorithms" by Jean Meeus, Chapter 7

      // J2000.0 epoch: January 1, 2000, 12:00 UTC
      toJulianDate({
      year: 2000, month: 1, day: 1,
      hour: 12, minute: 0, second: 0
      })
      // Returns: 2451545.0
      // With timezone (converted to UTC)
      toJulianDate({
      year: 2000, month: 1, day: 1,
      hour: 12, minute: 0, second: 0,
      timezone: -5 // EST
      })
      // Returns: 2451545.208333... (17:00 UTC)