toTCG
Signature
Section titled “Signature”toTCG(isoString: string): stringConvert a UTC instant to a Geocentric Coordinate Time string, YYYY-MM-DDTHH:MM:SS[.fraction] TCG.
- TCG = TT + (L_G / (1 − L_G)) × (TT − T₀), with L_G = 6.969290134 × 10⁻¹⁰ (IAU 2000 B1.9) and T₀ = 1977-01-01T00:00:32.184 TT, where the two coincide (IERS TN 36 §10.1, eq. 10.1). TT is TAI + 32.184 s, TAI from the built-in leap-second table.
- TCG runs ahead of TT by about 22 ms a year: about 1.08 s at the start of 2026, and TCG is behind TT before 1977.
tcgMinusTtreturns the gap. - The rate term is computed exactly and floored to the nanosecond (GMT’s nanosecond rule), so the result is the nanosecond at or before the true TCG.
- An inserted leap second maps to its own TCG instant:
2016-12-31T23:59:60Zis2017-01-01T00:01:09.063736307 TCG. A second 60 on any other day returns "". - Accepts any offset or bracketed zone; TCG has no zone.
TCGis the FITS 4.0 time-scale token. - "" before 1972-01-01, for a result past year 9999, and on invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
isoString | string | ISO 8601 instant string |
Returns
Section titled “Returns”the TCG time-scale string, or "" on invalid input, a date before 1972, or a TCG result past year 9999
Examples
Section titled “Examples”import { toTCG } from "@northguild/gmt/timescale/convert";
toTCG("2026-01-01T00:00:00Z") // "2026-01-01T00:01:10.261661917 TCG"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.