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.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
date | Date | undefined | The 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
dateis not a validDate. - If
scaleis not a TimeScaleType, ordateis before 1972-01-01 for TAI, TT, TDB and GPS.
See
Example
ts
modifiedJulianDate(new Date('2000-01-01T00:00:00Z')); // 51544