Skip to content

toJulianDateParts

  • The core functions, which every industry uses.
toJulianDateParts(isoString: string, scale?: TimeScale): JulianDateParts | null

Convert a UTC instant to a two-part Julian Date { jd1, jd2 } on a time scale, exact to the nanosecond. The scale defaults to "UTC".

  • Two parts exist because one double near JD 2 460 000 resolves only to about 40 µs. For a single number use toJulianDate.
  • JD days begin at noon (IAU 1997 B1 App. 2): midnight UTC has jd2 = 0.5.
  • jd1 is a whole number and jd2 lies in [0, 1). fromJulianDateParts accepts any split.
  • jd2 is one correctly rounded division (IEEE 754-2019 §4.3), within 2⁻⁵⁴ day (0.0048 ns) of the exact value; times at most 86 401 s that stays under 0.01 ns, so rounding to the nearest nanosecond recovers the input: fromJulianDateParts(toJulianDateParts(x, s), s) is x in Z form with Temporal’s shortest fraction, on every instant in the domain and every scale.
  • On "UTC" the count is ERFA’s quasi-JD: a leap-second day counts as one day, so noon on that day is not .0, and the difference between two UTC JDs is not an exact interval (ERFA dtf2d.c Notes 4 and 7). On "TAI", "TT" and "TCG" it is a true JD, read from the label toTAI / toTT / toTCG writes. TDB is not available.
  • Accepts any offset or bracketed zone, and a listed leap second …T23:59:60Z.
  • Domain: 1972-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z UTC; null outside it.
ParameterTypeDescription
isoStringstringISO 8601 instant string
scaleTimeScalethe time scale to count on, default "UTC"

the two parts, or null on invalid input, an unknown scale or an instant outside the domain

import { toJulianDateParts } from "@northguild/gmt/timescale/convert";
toJulianDateParts("2000-01-01T12:00:00Z") // { jd1: 2451545, jd2: 0 }
output 

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