Skip to content

GMT and the other libraries

  • The core functions, which every industry uses.

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? draws charts from the same data.

For what each library returns on the same inputs, see Behaviour of date libraries against Temporal.

  • @northguild/gmt

    Test cases
    78,184
    CI test executions
    2,345,520
    Node versions in CI
    3 (22, 24, 26)
    Time zones
    10
    Locales
    17
    Known failing tests
    0
    Fails in our zone matrix
    0
    Built on
    TC39 Temporal
    Finest time unit
    Nanosecond
  • @internationalized/date

    Test cases
    386
    CI test executions
    386
    Node versions in CI
    1
    Time zones
    0
    Locales
    0
    Known failing tests
    0
    Fails in our zone matrix
    0
    Built on
    not TC39
    Finest time unit
    Millisecond
  • Luxon

    Test cases
    1,222
    CI test executions
    4,888
    Node versions in CI
    4
    Time zones
    0
    Locales
    0
    Known failing tests
    not measured
    Built on
    built on Date
    Finest time unit
    Millisecond
  • date-fns

    Test cases
    3,167
    CI test executions
    1,209,794
    Node versions in CI
    4
    Time zones
    378
    Locales
    0
    Known failing tests
    0
    Fails in our zone matrix
    0
    Built on
    built on Date
    Finest time unit
    Millisecond
  • Moment.js

    Test cases
    3,944
    CI test executions
    11,832
    Node versions in CI
    3
    Time zones
    0
    Locales
    140
    Known failing tests
    0
    Built on
    built on Date
    Finest time unit
    Millisecond
  • Day.js

    Test cases
    794
    CI test executions
    1,034
    Node versions in CI
    1
    Time zones
    6
    Locales
    42
    Known failing tests
    1
    Built on
    built on Date
    Finest time unit
    Millisecond
  • Spacetime

    Test cases
    8,910
    CI test executions
    43,698
    Node versions in CI
    5
    Time zones
    22
    Locales
    6
    Known failing tests
    0
    Fails in our zone matrix
    0
    Built on
    leans on Date
    Finest time unit
    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.

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.

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.

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.

CapabilityGMTAlso has it
Duration type (ISO 8601 parse, format, arithmetic)YesLuxon Duration
Interval and range math (contains, overlap, union, intersection, split, set operations)YesLuxon Interval, date-fns areIntervalsOverlapping
DST disambiguation control on construction and on arithmeticYesNone 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 roundingYestemporal-kit (arithmetic only)
Interval rounding-out (boundary count, from a duration)YesLuxon
Locale calendar metadata (names, hasDST)YesLuxon Info
Overlap-day count, relative rounding, DST transitions, hours in a dayYesdate-fns, @internationalized/date
Field setters, token-pattern parsing, named machine formats, calendar-style formattingYesLuxon .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.

  1. TemporalThe TC39 standard. Separate types for instants, wall-clock times, zoned times, plain dates, and durations. No Date anywhere.TC39 standard
  2. @northguild/gmtTemporal underneath, with an ISO 8601 string-in / typed-value-out surface on top. The layer you actually write against.Temporal inside
  3. DateEpoch milliseconds interpreted through the host timezone. Every fault above lives here.root cause
  4. LuxonA DateTime is a Date plus a zone string. Invalid inputs become an Invalid DateTime you have to remember to check for.built on Date
  5. date-fnsTree-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.built on Date
  6. Moment.jsA 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.built on Date
  7. Day.jsWraps 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.built on Date
  8. Spacetimenow()/today() default through Date.now(), the system clock. Its own suite passes in full.leans on Date
  9. @internationalized/dateIts own CalendarDate / ZonedDateTime types. Fixes the model, but it is Adobe's API — a second migration once Temporal ships.not TC39

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.

TopicGMTWhat each other library's measurement shows
Time zonesThe 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.
Locales17 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 onTC39 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 executions2,345,520All 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.

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.

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.