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

    Function fromJulianDate

    • Converts a Julian Date to a Gregorian calendar date and time

      This is the inverse operation of toJulianDate(). It extracts the calendar date components (year, month, day) and time components (hour, minute, second) from a Julian Date number.

      The algorithm automatically handles:

      • Gregorian calendar (dates after Oct 15, 1582)
      • Julian calendar (dates before Oct 5, 1582)
      • Fractional days → time components
      • Negative years (BCE dates)

      Parameters

      • jd: number

        Julian Date (can be fractional)

      Returns CalendarDateTime

      CalendarDateTime object with year, month, day, hour, minute, second

      // J2000.0 epoch
      const date = fromJulianDate(2451545.0);
      // Returns: { year: 2000, month: 1, day: 1, hour: 12, minute: 0, second: 0 }

      // Unix epoch
      const unix = fromJulianDate(2440587.5);
      // Returns: { year: 1970, month: 1, day: 1, hour: 0, minute: 0, second: 0 }