Skip to content

Documentation / @interstellar-tools/temporal / dateFromJulianDate

Function: dateFromJulianDate() ​

ts
function dateFromJulianDate(jd: number, scale?: TimeScaleType): Date;

Defined in: time-scales.ts:243

The UTC Date of a Julian date in a time scale: the inverse of julianDate.

Notes

  • The result is rounded to the millisecond, the precision of a Date.
  • A TAI or TT Julian date that falls inside a leap second, 23:59:60 UTC, has no Date: it becomes 00:00:00 of the next day.

Parameters ​

ParameterTypeDefault valueDescription
jdnumberundefinedThe Julian date in days (finite).
scale?TimeScaleType'UTC'The time scale the Julian date counts in. Defaults to UTC.

Returns ​

Date

The moment as a Date.

Throws ​

  • If jd is not a finite number.
  • If scale is not a TimeScaleType, the moment is before 1972-01-01 for TAI, TT, TDB and GPS, or it's outside the range of a Date.

Example ​

ts
dateFromJulianDate(2451545, 'TT').toISOString(); // '2000-01-01T11:58:55.816Z'