# @northguild/gmt

Current release: **v1.23.1**

`@northguild/gmt` is built on the published standards for dates and times, not on a
library's own idea of them: [TC39 Temporal](https://tc39.es/proposal-temporal/) for the
types and arithmetic, [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
and [RFC 9557](https://www.rfc-editor.org/rfc/rfc9557) for every string in and out, and
the IANA Time Zone Database for zones. On top of that sits a smaller, opinionated API for
what application code actually needs — arithmetic, comparison, parsing, formatting, unix
conversions, timezone conversion and validation — tested against those standards and exact
to the nanosecond at the edges of Temporal's range. No hardcoded offset tables, no `Date` object: every zone on
the globe is computed live in your browser and recomputed every second.

## Built on the standards

Published standards decide every answer, not a library's own idea.

**TC39 Temporal**

The standard JavaScript date API. No `Date`, enforced by lint.

**ISO 8601 · RFC 9557**

Standard strings in and out, zones annotated.

**IANA zones · CLDR**

Real zone ids and the locale data your runtime ships.

**Explicit DST**

Gaps and overlaps resolve the way you choose.

**World calendars**

Hebrew, Islamic, Japanese, Persian and more.

**Freight formats**

EDIFACT, X12 and EPCIS. Never an invented offset.

[Every standard, in one place →](/gmt/guides/concepts/standards/)

## Tested and precise

Checked against the specs themselves, exact to the nanosecond.

**No borrowed oracle**

Answers come from the specs and test262, never the polyfill.

**~2× more CI runs**

2,350,440 executions, against 6 libraries combined.

**Correct at the edges**

Midnight, DST and the range limits are named tests.

**Safeguards**

Invalid input is validated, not thrown at your app.

**Nanoseconds**

Exact `bigint` time. The others stop at milliseconds.

**Zero known bugs**

None of 78,348 tests skipped or expected to fail.

[See the evidence →](/gmt/guides/concepts/correct-at-the-edges/)

## The bug is the `Date` object

`Date` mixes an instant with a wall-clock reading, and mutates in place.

| You write | You get |
| --- | --- |
| `new Date("2025-01-15")` | Tue Jan 14 2025 19:00 GMT−5 |
| `new Date("2025-03-30T01:30")` | 02:30 — no error |
| `new Date(2025, 3, 1)` | April 1, not March 1 |
| `d.setDate(d.getDate() + 1)` | mutates d in place |
| `same code, two machines` | two different answers |

[Why GMT →](/gmt/why-gmt/)

## The alternatives inherit it

Popular libraries decorate `Date`, so its faults come along.

| Layer | Built on |
| --- | --- |
| **Temporal** | TC39 standard |
| **@northguild/gmt** | Temporal inside |
| **Date** | root cause |
| **Luxon** | built on Date |
| **date-fns** | built on Date |
| **Moment.js** | built on Date |
| **Day.js** | built on Date |
| **Spacetime** | leans on Date |
| **@internationalized/date** | not TC39 |

[Compare the libraries →](/gmt/compare/)
