fromModifiedJulianDate
Signature
Section titled “Signature”fromModifiedJulianDate(mjd: number, scale?: TimeScale): stringConvert a Modified Julian Date on a time scale to a UTC instant string. The scale defaults to "UTC".
- The inverse of
toModifiedJulianDate. The double is read exactly (mjd − 40587days since 1970-01-01), then rounded once to the nearest nanosecond, a half rounding up (Temporal’shalfExpand). - MJD = JD − 2 400 000.5 and counts from midnight, not noon:
51544is midnight,51544.5noon. - A double from
toModifiedJulianDateis at most ½ ulp(MJD) days from the instant: 0.31 µs for 1972 to 2038-04-22, growing to 20.1 µs (2⁻³² day) by year 9999, as MJD stays below 2²². For nanoseconds usefromJulianDateParts. - On
"UTC"the count is ERFA’s quasi-MJD: a day with a leap second counts as one day, so on a leap-second day the fraction 86400/86401 of the day is where…T23:59:60Zbegins. On"TAI","TT"and"TCG"it is a true count. TDB is not available. - Returns
"Z"form with Temporal’s shortest fraction, and…:60inside an inserted second. mjdmust be a finite number; a bigint, a numeric string,NaNorInfinitygives "".- Domain: 1972-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z UTC; "" outside it.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
mjd | number | the Modified Julian Date |
scale | TimeScale | the time scale the date is counted on, default "UTC" |
Returns
Section titled “Returns”ISO 8601 UTC instant string (Z), or "" on invalid input, an unknown scale or a date outside the domain
Related types
Section titled “Related types”Examples
Section titled “Examples”import { fromModifiedJulianDate } from "@northguild/gmt/timescale/convert";
fromModifiedJulianDate(51544) // "2000-01-01T00:00:00Z"Source
Section titled “Source”© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.