API Reference / calendarDate · function
Function: calendarDate()
function calendarDate(jd, calendar?): CalendarDate;
Convert a Julian Day to a calendar date, the inverse of julianDay (Meeus, Astronomical Algorithms, ch. 7).
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
jd | number | undefined | Julian Day. |
calendar | Calendar | "gregorian" | The calendar to express the date in. Defaults to "gregorian". |
Returns
Year, month, day, and the time of day in hours.
Example
calendarDate(2451545.0); // { year: 2000, month: 1, day: 1, hour: 12 }
calendarDate(1748839.75, "julian"); // { year: 76, month: 1, day: 24, hour: 6 }