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:
Julian Date (can be fractional)
CalendarDateTime object with year, month, day, hour, minute, second
// J2000.0 epochconst date = fromJulianDate(2451545.0);// Returns: { year: 2000, month: 1, day: 1, hour: 12, minute: 0, second: 0 }// Unix epochconst unix = fromJulianDate(2440587.5);// Returns: { year: 1970, month: 1, day: 1, hour: 0, minute: 0, second: 0 } Copy
// J2000.0 epochconst date = fromJulianDate(2451545.0);// Returns: { year: 2000, month: 1, day: 1, hour: 12, minute: 0, second: 0 }// Unix epochconst unix = fromJulianDate(2440587.5);// Returns: { year: 1970, month: 1, day: 1, hour: 0, minute: 0, second: 0 }
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: