toJ2000Seconds
Signature
Section titled “Signature”toJ2000Seconds(isoString: string, scale?: TimeScale): number | nullConvert a UTC instant to seconds since J2000.0 on a time scale. The scale defaults to "TT", unlike the Julian Date and MJD functions, which default to "UTC": J2000.0 is defined as 2000-01-01T12:00:00 TT (IAU 1994 Resolution C7).
- The result is (JD on the scale − 2451545.0) × 86 400 (ERFA
ERFA_DJ00,ERFA_DAYSEC). On"TT"it counts TT seconds from J2000.0 itself; on"TAI"and"TCG"it counts from the label2000-01-01T12:00:00on that scale. - On
"UTC"it is the quasi-JD count (ERFAdtf2d.cNotes 4 and 7). On every day without a leap second it equals Unix seconds minus 946 728 000. On a day with one, the 86 401 s are scaled to fill 86 400, so, like Unix time, the difference between two UTC values is not an exact interval. - TDB is not available, so this is not the “ephemeris seconds past J2000”, which count on TDB.
- Precision: the result is the double nearest the exact count (rounded once, ties to even), so the error is at most half an ulp of the result. Seconds since J2000 in one double keep a spacing (ulp) of at most 2⁻²³ s (0.12 µs) for |seconds| < 2³⁰ (about 1966 to 2034), so a value is off by at most 0.06 µs (half an ulp), and a spacing of 30.5 µs at year 9999, a value off by at most 15 µs. Callers needing nanoseconds should use
toJulianDateParts. - 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. Within about 15 µs (half an ulp) of the end of 9999 (on UTC, TAI and TCG) it also returnsnull, because the nearest double lies past the domain andfromJ2000Secondswould reject it;toJulianDatePartscovers the whole domain exactly.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
isoString | string | ISO 8601 instant string |
scale | TimeScale | the time scale to count on, default "TT" |
Returns
Section titled “Returns”seconds since J2000.0 (negative before it), 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 { toJ2000Seconds } from "@northguild/gmt/timescale/convert";
toJ2000Seconds("2000-01-01T11:58:55.816Z") // 0 — J2000.0 itselfSource
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.