Skip to content

Documentation / @interstellar-tools/temporal / modifiedJulianDate

Function: modifiedJulianDate() ​

ts
function modifiedJulianDate(date: Date, scale?: TimeScaleType): number;

Defined in: time-scales.ts:204

The modified Julian date of a moment, in a time scale: the Julian date minus 2 400 000.5, so days start at midnight and MJD 0 is 1858-11-17.

MJD=JD−2400000.5

Parameters ​

ParameterTypeDefault valueDescription
dateDateundefinedThe moment, as a UTC Date (on or after 1972-01-01 for TAI, TT, TDB and GPS).
scale?TimeScaleType'UTC'The time scale to count in. Defaults to UTC.

Returns ​

number

The modified Julian date in days.

Throws ​

  • If date is not a valid Date.
  • If scale is not a TimeScaleType, or date is before 1972-01-01 for TAI, TT, TDB and GPS.

See ​

julianDate

Example ​

ts
modifiedJulianDate(new Date('2000-01-01T00:00:00Z')); // 51544