# GMT and the other libraries

Industry: Core

This page sets GMT beside 6 other date libraries: what each
one's own test suite and CI run, what each is built on, and what each covers. Every figure
can be checked. The second section names the version, commit, date and command behind it.

The summary on [Why GMT?](/gmt/why-gmt/) draws charts from the same data.

For what each library returns on the same inputs, see [Behaviour of date libraries against Temporal](/gmt/compare/behaviour/).

## The full table

| Library | Test cases | CI test executions | Node versions in CI | Time zones | Locales | Known failing tests | Fails in our zone matrix | Built on | Finest time unit |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| @northguild/gmt | 78,184 | 2,345,520 | 3 (22, 24, 26) | 10 | 17 | 0 | [0](/gmt/compare/zone-matrix/) | TC39 Temporal | Nanosecond |
| @internationalized/date | 386 | 386 | 1 | 0 | 0 | 0 | [0](/gmt/compare/zone-matrix/) | not TC39 | Millisecond |
| Luxon | 1,222 | 4,888 | 4 | 0 | 0 | not measured | [7 (7 assume one zone, 0 wrong answers)](/gmt/compare/zone-matrix/) | built on Date | Millisecond |
| date-fns | 3,167 | 1,209,794 | 4 | 378 | 0 | 0 | [0](/gmt/compare/zone-matrix/) | built on Date | Millisecond |
| Moment.js | 3,944 | 11,832 | 3 | 0 | 140 | 0 | [8 (0 assume one zone, 8 wrong answers)](/gmt/compare/zone-matrix/) | built on Date | Millisecond |
| Day.js | 794 | 1,034 | 1 | 6 | 42 | 1 | [5 (5 assume one zone, 0 wrong answers)](/gmt/compare/zone-matrix/) | built on Date | Millisecond |
| Spacetime | 8,910 | 43,698 | 5 | 22 | 6 | 0 | [0](/gmt/compare/zone-matrix/) | leans on Date | Millisecond |

How to read the columns:

- **Test cases** is the number of tests in one run of the library's own suite.
- **CI test executions** is the test cases multiplied by every Node version and time-zone
  run the library's own CI applies.
- **Time zones**: for GMT, the zones the whole suite runs in. For the others, the zones
  their dedicated time-zone and DST test files cover. A 0 means none was found.
- **Locales**: for GMT, the locales every locale-aware function is tested in. For the
  others, the locale test files their repository holds.
- **Known failing tests** counts tests that fail on the library's own default branch.
  "Not measured" means the figure was not taken. Failures caused by the measuring machine
  are not counted here; see the notes below.
- **Fails in our zone matrix** counts the tests of the library's own suite that fail when
  it runs in the time zones GMT's CI uses, split into tests that assume one zone and wrong
  answers. See [the zone matrix](/gmt/compare/zone-matrix/).

## How these were measured

Each figure for the other libraries is a snapshot taken on the date in the table, between
2026-11-11 and 2026-11-11. Libraries change their tests and
CI, so check the date before you cite a figure. GMT's own figures are not a snapshot:
`scripts/stats.mjs` regenerates them from this repository on every change, and the build
fails if a published figure drifts from the repository.

| Library | Version tested | Repository and commit | Measured on | Command | CI configuration |
| --- | --- | --- | --- | --- | --- |
| @northguild/gmt | this repository | this repository | every change | collected from the suite by scripts/stats.mjs | `.github/workflows/ci.yml` |
| @internationalized/date | 3.12.4 | `adobe/react-spectrum@d354aa2` | 2026-11-11 | `npx jest packages/@internationalized/date/tests/` | [adobe/react-spectrum/blob/main/.circleci/config.yml](https://github.com/adobe/react-spectrum/blob/main/.circleci/config.yml) |
| Luxon | 3.7.2 | `moment/luxon@f427515` | 2026-11-11 | `jest` | [moment/luxon/blob/master/.github/workflows/test.yml](https://github.com/moment/luxon/blob/master/.github/workflows/test.yml) |
| date-fns | 4.4.0 | `date-fns/date-fns@a9739fb` | 2026-11-11 | `pnpm vitest run --project main` | [date-fns/date-fns/tree/main/.github/workflows](https://github.com/date-fns/date-fns/tree/main/.github/workflows) |
| Moment.js | 2.31.0 | `moment/moment@c2a703a` | 2026-11-11 | `node scripts/test.js` | [moment/moment/tree/develop/.github/workflows](https://github.com/moment/moment/tree/develop/.github/workflows) |
| Day.js | 1.11.23 | `iamkun/dayjs@d3e43be` | 2026-11-11 | `npm test` | [iamkun/dayjs/blob/dev/.github/workflows/lint-test.yml](https://github.com/iamkun/dayjs/blob/dev/.github/workflows/lint-test.yml) |
| Spacetime | 7.17.1 | `spencermountain/spacetime@35fbb59` | 2026-11-11 | `pnpm run test` | [spencermountain/spacetime/tree/master/.github/workflows](https://github.com/spencermountain/spacetime/tree/master/.github/workflows) |

Test cases for each library were obtained by cloning its repository at the commit shown,
installing its dependencies, running the project's own test command, and reading that
runner's final summary. They were not counted from the source. CI test executions come from
each project's public CI configuration, linked in the last column: the test count
multiplied by the Node versions and time-zone runs that configuration applies.

The notes below record how each library's figures were reached, and what a reader needs to
read them correctly.

- **@internationalized/date.** All 386 tests passed. The suite runs once: CI tests React 16 to canary, not a range of Node versions. The 12 methods on the Calendar interface are counted once, not again on each of its 13 implementations.
- **Luxon.** CI (.github/workflows/test.yml) runs `npm run test` on Node 20, 22, 24 and 25 under one fixed time zone, America/New_York, so executions are 1,222 × 4. The 46 local failures come from the machine: the suite assumes its CI container's local time zone is America/New_York. They do not change the test count. Luxon ships no types, so the API was counted from @types/luxon 3.7.6, which tracks 3.7.x.
- **date-fns.** The suite runs the `main` Vitest project. CI (node_tests.yaml) runs it on Node 22, 24, 25 and 26, so that part is 3,167 × 4. A second workflow (tz_tests.yaml) runs the same 3,167 tests under all 378 time-zone settings of its own tool, so executions are 3,167 × 4 + 3,167 × 378 = 1,209,794. All 378 zones passed. The `temporarily` project is not run by CI and is not counted. `formatDate` is an alias of `format`, counted once. The 1 method is the function-typed member of the exported Localize type.
- **Moment.js.** 0 tests failed on Node 24. CI (.github/workflows/ci.yml) runs `pnpm test` on three Node versions (lts/*, lts/-1, latest), so executions are 3,944 × 3. timezones.yml re-runs 5 test modules, not the full suite, under 6 zones; those partial runs are not counted. The repository holds 193 test files; `locales` counts the 140 of them that test a locale.
- **Day.js.** A single default run is 93 suites and 794 tests. 793 pass and 1 fails: the failure is in the upstream code and also appears at the earlier commit, so it is counted under known failures. The repository's `test` script first re-runs test/timezone.test.js (6 tests) and test/plugin/timezone.test.js (54 tests) under 6 distinct TZ values (Pacific/Auckland, Europe/London, America/Whitehorse, the system default, Europe/Paris, America/New_York), then runs the full jest suite: 4 × 6 + 4 × 54 + 794 = 1,034 executions. `locales` counts test/locale.test.js plus the 41 files in test/locale/. CI runs `npm test` on a single Node LTS. The API count covers the core and the 37 plugins shipped in the same npm package; core alone is 4 functions and 30 methods. The commit is on the `dev` branch, where `package.json` carries the placeholder version `0.0.0-development`: its `src`, `test` and `types` trees are the same as those of the tag v1.11.23.
- **Spacetime.** All 8,910 tests passed. CI runs Node 20, 22, 24, 25 and 26 (the suite has 8,697 tests on the four older versions and 8,910 on the newest), so executions are 4 × 8,697 + 8,910 = 43,698. `locales` counts the 6 locale test files. `timezones` counts the 22 dedicated time-zone and DST test files that run. The `spacetime/temporal` entry point is not counted in the API.

## What each library covers

GMT is compared with `@internationalized/date`, Luxon, date-fns and Moment.js
capability by capability. Day.js and Spacetime have not been compared this way, so the
last column names only those four (and `temporal-kit`, a package for business-day
arithmetic). Where it says "None of the others", it means none of those four.

| Capability | GMT | Also has it |
| --- | --- | --- |
| Duration type (ISO 8601 parse, format, arithmetic) | Yes | Luxon `Duration` |
| Interval and range math (contains, overlap, union, intersection, split, set operations) | Yes | Luxon `Interval`, date-fns `areIntervalsOverlapping` |
| DST disambiguation control on construction and on arithmetic | Yes | None of the others exposes this on arithmetic |
| Locale-aware calendar helpers (weekend, week start and end, day of week) | Yes | `@internationalized/date` |
| Business-day arithmetic with holiday calendars and roll conventions, clamp and closest, time rounding | Yes | `temporal-kit` (arithmetic only) |
| Interval rounding-out (boundary count, from a duration) | Yes | Luxon |
| Locale calendar metadata (names, `hasDST`) | Yes | Luxon `Info` |
| Overlap-day count, relative rounding, DST transitions, hours in a day | Yes | date-fns, `@internationalized/date` |
| Field setters, token-pattern parsing, named machine formats, calendar-style formatting | Yes | Luxon `.set()`, `toRFC2822`, `toHTTP` and `toSQL`; Moment `.calendar()` |
| Non-Gregorian calendar systems (conversion and calendar-aware interval and duration math) | Yes | `@internationalized/date`'s `toCalendar` |

## The alternatives inherit it, or deviate from the standard

The popular libraries do not replace `Date`; they decorate it, so the faults come along — our gmt lint packages ban the Date wrappers below outright. The one library that fixes the model does it with a non-standard API you will migrate off. GMT is Temporal — the standard — with the ergonomics added on top.

| Layer | Built on | What it is |
| --- | --- | --- |
| **Temporal** | TC39 standard | The TC39 standard. Separate types for instants, wall-clock times, zoned times, plain dates, and durations. No Date anywhere. |
| **@northguild/gmt** | Temporal inside | Temporal underneath, with an ISO 8601 string-in / typed-value-out surface on top. The layer you actually write against. |
| **Date** | root cause | Epoch milliseconds interpreted through the host timezone. Every fault above lives here. |
| **Luxon** | built on Date | A DateTime is a Date plus a zone string. Invalid inputs become an Invalid DateTime you have to remember to check for. |
| **date-fns** | built on Date | Tree-shakeable functions — but every argument and every return value is a Date, so all of its footguns are still yours. Our gmt lint packages also ban the companion date-fns-tz, @date-fns/tz packages. |
| **Moment.js** | built on Date | A wrapper around Date. In legacy maintenance mode since 2020, and mutable like the thing it wraps. Our gmt lint packages also ban the companion moment-timezone package. |
| **Day.js** | built on Date | Wraps a real Date instance under the hood. Its timezone plugin is graded against moment's output — it can't verify itself without the library it replaces. |
| **Spacetime** | leans on Date | now()/today() default through Date.now(), the system clock. Its own suite passes in full. |
| **@internationalized/date** | not TC39 | Its own CalendarDate / ZonedDateTime types. Fixes the model, but it is Adobe's API — a second migration once Temporal ships. |

## Where GMT differs

Each row says what GMT does and what each other library's measurement shows. The rows name
every library instead of saying "only GMT", because a claim of that kind must hold against
all 6 libraries in the data.

| Topic | GMT | What each other library's measurement shows |
| --- | --- | --- |
| Time zones | The whole suite runs in each of 10 zones on each of 3 Node versions: 30 full-suite runs | @internationalized/date has no time-zone matrix in its CI. Luxon has no time-zone matrix in its CI. date-fns re-runs its whole suite under 378 time-zone settings. Moment.js re-runs 5 time-zone test modules under 6 zones, not the full suite. Day.js re-runs 2 time-zone test files under 6 zones, not the full suite. Spacetime has 22 time-zone test files, run once per Node version. |
| Locales | 17 locales, run inside the 78,184 tests so that every locale-aware function meets all of them | @internationalized/date has no locale tests. Luxon has no locale tests. date-fns has no locale tests. Moment.js has 140 locale test files. Day.js has 42 locale test files. Spacetime has 6 locale test files. |
| What it is built on | TC39 Temporal. Lint packages for ESLint, Oxlint and Biome ban Date in your own code | @internationalized/date: not TC39. Luxon: built on Date. date-fns: built on Date. Moment.js: built on Date. Day.js: built on Date. Spacetime: leans on Date. |
| CI test executions | 2,345,520 | All 6 other libraries combined: 386 + 4,888 + 1,209,794 + 11,832 + 1,034 + 43,698 = 1,271,632. GMT's figure is about 2 times that |

Executions are test cases multiplied by the Node versions and time-zone runs CI applies. A
library with a larger suite but a single run can still execute fewer tests than GMT does.
The multiple is GMT's 2,345,520 divided by 1,271,632,
the executions of all 6 other libraries added together:
about 2 times.

## How GMT's own suite is designed

GMT's suite balances thoroughness against maintenance by testing behavior, not
permutations.

**What it tests exhaustively**

- **The locale matrix.** Every locale-aware function runs in all 17 locales of the
  matrix: en-US, en-GB, de-DE, fr-FR, es-ES, it-IT, pt-PT, sv-SE, is-IS, zh-CN, zh-TW, ja-JP, ko-KR, ar-SA, he-IL, ru-RU, tr-TR. The set covers script direction,
  first-day-of-week differences and calendar metadata.
- **The time-zone matrix.** Every zoned function runs in 10 IANA time zones that span every UTC
  offset band, from Pacific/Niue (UTC−11) to Pacific/Chatham (UTC+13:45).
  The set includes zones with DST transitions and zones at half-hour offsets.
- **Zero-length and identity cases.** Every interval and arithmetic function is tested with
  zero-length inputs, identity operations and values next to a boundary.
- **Invalid-input sentinels.** Every public function is tested for its documented fallback
  (`""`, `null`, `false` or `[]`) on malformed strings, wrong types, leap seconds and
  inverted intervals.

**What it collapses**

- **Non-string input tables.** A function that guards with `typeof x !== "string"` returns
  the same sentinel for `null`, `undefined`, `123`, `true`, `[]` and `{}`. The suite tests
  one representative non-string per argument position, not every type at every position.
  That is safe because every non-string type reaches the same early return.
- **Repeated permutations.** Adjacent, disjoint and reversed interval cases that give
  identical results are not repeated for every function variant. The `plain`, `zoned`,
  `utc` and `unix` families share the same mathematical behavior, so each family gets the
  fewest cases that prove it.

**The result.** 78,184 tests in 1,034 files. CI runs them as
2,345,520 executions: every test, in 3 Node versions and 10 time zones,
which is 30 runs of each test.
