Skip to content

fromJulianDateParts

  • The core functions, which every industry uses.
fromJulianDateParts(parts: JulianDateParts, scale?: TimeScale): string

Convert a two-part Julian Date on a time scale to a UTC instant string. The scale defaults to "UTC".

  • The inverse of toJulianDateParts. The two doubles are read exactly and summed exactly (jd1 + jd2 − 2440587.5 days since 1970-01-01), then rounded to the nearest nanosecond, a half rounding up (Temporal’s halfExpand). On "UTC", "TAI" and "TT" that rounds the instant. On "TCG" it rounds the TCG label, which fromTCG then maps to UTC (flooring to the TT nanosecond), so the result can be 1 ns later than the exact inverse of the date. The round trip with toJulianDateParts stays exact.
  • Any split works (ERFA jd2cal.c Note 2): {2451545, 0}, {2400000.5, 51544.5}, {0, 2451545} and {2451545.5, -0.5} give the same instant, though a split that puts everything into one part has already lost precision in that double.
  • JD days begin at noon: { jd1: 2451544, jd2: 0.5 } is midnight UTC.
  • On "UTC" the count is ERFA’s quasi-JD: a day with a leap second counts as one day, so a fraction past the end of an ordinary day reads as …T23:59:60Z on a leap-second day. On "TAI", "TT" and "TCG" it is a true JD. TDB is not available.
  • Returns "Z" form with Temporal’s shortest fraction, and …:60 inside an inserted second.
  • Both members must be finite numbers; a bigint, a numeric string, NaN or a missing member gives "".
  • Domain: 1972-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z UTC; "" outside it.
ParameterTypeDescription
partsJulianDatePartsthe two-part 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 { fromJulianDateParts } from "@northguild/gmt/timescale/convert";
fromJulianDateParts({ jd1: 2451545, jd2: 0 }) // "2000-01-01T12:00:00Z"
output 

timescale/convert/fromJulianDateParts.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.