# fromJulianDate

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
fromJulianDate(jd: number, scale?: TimeScale): string
```

Convert a single Julian Date on a time scale to a UTC instant string. The scale defaults to `"UTC"`.

- The inverse of `toJulianDate`. The double is read exactly (`jd − 2440587.5` days since 1970-01-01) and rounded once to the nearest nanosecond, a half rounding up (Temporal's `halfExpand`), so the only loss is the one already in `jd`: a double near JD 2 460 000 is spaced about 40 µs apart. For nanosecond precision use `fromJulianDateParts`.
- JD days begin at noon: `2451544.5` is midnight UTC.
- On `"UTC"` the count is ERFA's quasi-JD, the same as `toJulianDateParts`: a day with a leap second counts as one day. On `"TAI"`, `"TT"` and `"TCG"` it is a true JD. TDB is not available.
- Returns `"Z"` form with Temporal's shortest fraction, and `…:60` inside an inserted second.
- `jd` must be a finite number; a bigint, a numeric string, `NaN` or `Infinity` gives "".
- Domain: 1972-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z UTC; "" outside it.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `jd` | `number` | the Julian Date |
| `scale` | `TimeScale` | the time scale the date is counted on, default `"UTC"` |

## Returns

ISO 8601 UTC instant string (`Z`), or "" on invalid input, an unknown scale or a date outside the domain

## Related types

- [`TimeScale`](/gmt/reference/types/TimeScale/)

## Examples

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

fromJulianDate(2451545) // "2000-01-01T12:00:00Z"
```

## Source

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