toJulianDateParts
Signature
Section titled “Signature”toJulianDateParts(isoString: string, scale?: TimeScale): JulianDateParts | nullConvert 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. jd1is a whole number andjd2lies in [0, 1).fromJulianDatePartsaccepts any split.jd2is 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)isxinZform 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 (ERFAdtf2d.cNotes 4 and 7). On"TAI","TT"and"TCG"it is a true JD, read from the labeltoTAI/toTT/toTCGwrites. 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;
nulloutside it.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
isoString | string | ISO 8601 instant string |
scale | TimeScale | the time scale to count on, default "UTC" |
Returns
Section titled “Returns”the two parts, or null on invalid input, an unknown scale or an instant outside the domain
Related types
Section titled “Related types”Examples
Section titled “Examples”import { toJulianDateParts } from "@northguild/gmt/timescale/convert";
toJulianDateParts("2000-01-01T12:00:00Z") // { jd1: 2451545, jd2: 0 }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.