# fromPgMicroseconds

Industry: Core

## Signature

```ts
fromPgMicroseconds(value: bigint): string
```

Convert PostgreSQL's internal `timestamptz` value back to an ISO 8601 instant string.

- `value` is a signed count of microseconds since 2000-01-01T00:00:00Z, the number PostgreSQL stores and the binary wire format carries. It is not a Unix timestamp.
- Accepted range is the narrower of PostgreSQL's and `Temporal.Instant`'s, one binding at each end: `-211813488000000000n` (`MIN_TIMESTAMP`, `-004713-11-24T00:00:00Z` — the manual's "4713 BC", counted in the Julian calendar) up to `8639053315200000000n` (`+275760-09-13`, where `Temporal` stops, well before PostgreSQL's 294276 AD). Anything outside returns "".
- Exact in this direction — a microsecond is coarser than the nanoseconds an ISO string carries, so nothing is rounded. The loss, if any, happened in `toPgMicroseconds`.
- Returns "" on invalid input.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `bigint` | microseconds since 2000-01-01 (bigint) |

## Returns

ISO 8601 instant string (UTC), or "" on invalid input

## Examples

```ts
import { fromPgMicroseconds } from "@northguild/gmt/precision/convert";

fromPgMicroseconds(0n) // "2000-01-01T00:00:00Z" — the PostgreSQL epoch
```

## Source

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