# toTCG

Industry: Core

:::caution[Unreleased]
Not in `@northguild/gmt` 1.21.0 on npm yet. It is on `main` and ships in the next release.
:::

## Signature

```ts
toTCG(isoString: string): string
```

Convert 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. `tcgMinusTt` returns 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:60Z` is `2017-01-01T00:01:09.063736307 TCG`. A second 60 on any other day returns "".
- Accepts any offset or bracketed zone; TCG has no zone. `TCG` is the FITS 4.0 time-scale token.
- "" before 1972-01-01, for a result past year 9999, and on invalid input.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `isoString` | `string` | ISO 8601 instant string |

## Returns

the TCG time-scale string, or "" on invalid input, a date before 1972, or a TCG result past year 9999

## Examples

```ts
import { toTCG } from "@northguild/gmt/timescale/convert";

toTCG("2026-01-01T00:00:00Z") // "2026-01-01T00:01:10.261661917 TCG"
```

## Source

[timescale/convert/toTCG.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/timescale/convert/toTCG.ts)
