# fromTCG

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
fromTCG(tcgString: string): string
```

Convert a Geocentric Coordinate Time string to a UTC instant string.

- Reads `YYYY-MM-DDTHH:MM:SS[.fraction] TCG`: four-digit year, `T`, seconds required, 1 to 9 fraction digits after `.`, one space, `TCG` (the FITS 4.0 time-scale token). TCG has no second 60.
- TT = TCG − L_G × (TCG − T₀), the inverse of IERS TN 36 eq. 10.1 solved from dTT/dTCG = 1 − L_G (IAU 2000 B1.9) with T₀ from eq. 10.1; the floor is GMT's nanosecond rule. Then UTC from TT as `fromTT` does.
- Exact inverse of `toTCG` to the nanosecond. About one TCG nanosecond in 1.4 × 10⁹ is never written by `toTCG`; it reads as the next nanosecond's UTC instant.
- During an inserted leap second the result is `…T23:59:60Z` (ITU-R TF.460-6 Annex 3). Only the `timescale/`, `gnss/` and `finance/` functions read that string back; other GMT functions reject a second of 60.
- "" before 1972-01-01T00:00:42.07398781 TCG and on invalid input.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `tcgString` | `string` | TCG time-scale string |

## Returns

ISO 8601 UTC instant string (`Z`), or "" on invalid input or a date before 1972

## Examples

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

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

## Source

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