Skip to content

fromModifiedJulianDate

  • The core functions, which every industry uses.
fromModifiedJulianDate(mjd: number, scale?: TimeScale): string

Convert 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 − 40587 days since 1970-01-01), then rounded once to the nearest nanosecond, a half rounding up (Temporal’s halfExpand).
  • MJD = JD − 2 400 000.5 and counts from midnight, not noon: 51544 is midnight, 51544.5 noon.
  • A double from toModifiedJulianDate is 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 use fromJulianDateParts.
  • 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:60Z begins. On "TAI", "TT" and "TCG" it is a true count. TDB is not available.
  • Returns "Z" form with Temporal’s shortest fraction, and …:60 inside an inserted second.
  • mjd must be a finite number; a bigint, a numeric string, NaN or Infinity gives "".
  • Domain: 1972-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z UTC; "" outside it.
ParameterTypeDescription
mjdnumberthe Modified Julian Date
scaleTimeScalethe time scale the date is counted on, default "UTC"

ISO 8601 UTC instant string (Z), or "" on invalid input, an unknown scale or a date outside the domain

import { fromModifiedJulianDate } from "@northguild/gmt/timescale/convert";
fromModifiedJulianDate(51544) // "2000-01-01T00:00:00Z"
output 

timescale/convert/fromModifiedJulianDate.ts

© 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.