Why GMT?
@northguild/gmt is not the latest entry in a crowded field — it is a
fundamentally different bet about what a date/time library should guarantee.
The sections below make that concrete with data drawn from the library itself.
- 78,184tests in one run
- 2,345,520test runs in CI on every pull request
- 781public functions
- 10time zones, from UTC−11 to UTC+13:45
- 17locales in every test
The bug is the Date object
Section titled “The bug is the Date object”Almost every date/time bug in a JavaScript codebase traces back to one type. Date conflates an instant with a wall-clock reading, parses two ways depending on the string, and mutates in place.
- Fault
new Date("2025-01-15")Tue Jan 14 2025 19:00 GMT−5A bare date string is UTC midnight. West of Greenwich that is still the previous evening. Add a time and the rule silently flips to local.
- Fault
new Date("2025-03-30T01:30")02:30 — no error01:30 never happened in London that night — the clocks jumped 01:00 → 02:00. Date invents a nearby valid instant instead of telling you.
- Fault
new Date(2025, 3, 1)April 1, not March 1Months are 0-indexed. Days are 1-indexed. In the same constructor call.
- Fault
Date.UTC(2025, 0, 15, 9, 30)a millisecond count, not a dateYear, month, day, hour and minute are bare positional numbers, so a swapped pair still runs. Months count from 0, and a year from 0 to 99 is read as 1900 to 1999.
- Fault
d.setDate(d.getDate() + 1)mutates d in placeA Date handed to a function can be changed underneath you. There is no read-only Date.
- Fault
"09:00 every Tuesday, Tokyo"not representableA Date is a single integer — milliseconds since the epoch. It cannot hold a wall-clock time or a recurring local time.
- Fault
same code, two machinestwo different answersParsing and formatting use the host timezone. A laptop in Denver and a CI runner in UTC disagree.
- Fault
wrapper.now() / wrapper(dateString)a native Date, renamedMost Date-wrapping libraries store a real Date as their internal state and default their clock to it. Every fault above is still reachable — only the syntax changed.
- Fault
DST edge-case coveragethin, disabled, or failingDST transitions are the hardest case for a Date-shaped model to get right. It shows: wrapper libraries' own test suites are consistently the ones most likely to under-test, skip, or fail exactly this case.
- Fault
how a wrapper checks itselfagainst a sibling wrapper, not a specWith no independent standard to test against, a Date-wrapping library can only grade itself against another one — so a bug shared by the whole family passes every one of their suites.
CI test execution volume
Section titled “CI test execution volume”The most direct measure of testing rigor is how many times the library is actually executed in CI. GMT’s suite is 78,184 tests, and its 17-locale matrix is built into those tests rather than layered on top. On every PR, CI then re-runs the whole suite under 10 timezones and 3 Node versions, so every test runs 30 times.
Test executions per library
One run of each suite, before any CI matrix. GMT: 78,184 tests. Competitors: 386–8,910.
GMT: 78,184 tests, re-run across 10 timezones × 3 Node versions = 2,345,520 executions. Competitors: 386–1,209,794.
The split matters. On suite size alone, GMT’s 78,184 tests already outnumber the largest alternative’s (Spacetime, 8,910). The matrix is what turns that into 2,345,520 executions: about 2× the most-executed alternative and about 6,076× the least, against a surface area that is itself larger.
API surface
Section titled “API surface”GMT exposes 781 public functions across 21 namespaces, plus 33
regex patterns in regex. 12 namespaces are the core — `plain`, `zoned`, `utc`, `unix`, `precision`, `calendar`, `timescale`, `duration`, `interval`, `instant`, `span`, and `recurrence` — and
9 belong to one industry each: `intermodal`, `transport`, `workforce`, `aviation`, `finance`, `gnss`, `healthcare`, `rail`, and `iot`. All of it is generated
from the same TypeScript source and verified by the same test suite.
Public functions per namespace
671 core functions across 12 namespaces, plus 33 regex patterns. Every namespace shares one contract: ISO 8601 strings in, typed values out, no Date object.
The core is weighted toward plain and zoned, which hold 377 of its 671 functions.
plain has one set of operations for each wall-clock shape — dates, times and date-times —
and zoned carries them into a real time zone, where a day is not always 24 hours long.
utc and unix apply the same rules to UTC strings and epoch numbers.
- the industry's own functions
- a shared layer it draws on
- Workforce: 8 own functions.
- Transport: 15 own functions; draws on workforce, 8 functions (Workforce industry layer).
- Intermodal: 55 own functions; draws on transport, 15 functions (Transport industry layer).
- GNSS: 6 own functions; draws on timescale, 25 functions (Core).
- Maritime: no namespace of its own; draws on gnss, 6 functions (GNSS industry layer); draws on timescale, 25 functions (Core).
- Finance: 6 own functions.
- Healthcare: 6 own functions.
- Aviation: 7 own functions.
- Rail: 4 own functions; draws on transport, 15 functions (Transport industry layer).
- IoT: 3 own functions; draws on timescale, 25 functions (Core); draws on precision, 37 functions (Core).
110 functions across 9 industry layers; lighter segments are shared layers an industry draws on.
The industry layers are small on purpose. Each is built on the core, so every layer agrees on
what a midnight, a day or an elapsed hour is. The facts come from the caller: GMT does not
map a port to a time zone or look up a carrier’s free days, so it holds no registry that can
go stale. The intermodal layer also reads and writes the timestamp formats freight exchanges:
UN/EDIFACT DTM, ANSI X12 dates and time codes, and GS1 EPCIS 2.0 event times. Read the industry guides →
Timezone coverage
Section titled “Timezone coverage”GMT tests against 10 timezones chosen not for geographic spread but for offset coverage — from UTC−11 (Pacific/Niue) to UTC+13:45 (Pacific/Chatham). That 24.75-hour window means that at any given moment, at least one zone is already living in tomorrow while another is still stuck in yesterday. Date-boundary bugs — off-by-one day, wrong month rollover, DST gaps — only surface when the suite runs across this full offset range. A test that passes at UTC can fail at UTC+14 simply because the calendar date is different.
Locale matrix
Section titled “Locale matrix”GMT does not test every locale — there are hundreds, and most differ only in formatting minutiae. Instead it tests a curated matrix of 17 locales chosen to stress the dimensions that actually break date libraries: script direction (LTR/RTL Arabic and Hebrew), character sets (CJK, Cyrillic, Latin), pluralization rules, and ICU data variants. The goal is not exhaustive locale coverage — it is representative coverage of every class of bug that locale-aware code can produce.
Locale matrix by script family
17 locales across 5 script families. Latin (9), CJK (4), Arabic/Hebrew (2), Cyrillic (1), Turkic (1). Each cell shows the locale code and English name.
Correct at the edges
Section titled “Correct at the edges”Most date bugs hide at the extremes, where ordinary tests never look. GMT tests them directly:
- Midnight. A time at the last nanosecond of the day stays on that day.
- The ends of time. The first and last moments a date can represent still give exact answers.
- Daylight saving. Days, weeks and months start at the right moment across clock changes, right to the end of the calendar.
- Zones ahead of UTC. Sydney and Kiritimati work right up to the last moment that can be represented.
- Long totals. Adding up time stays exact to the nanosecond, however large the total.
- Touching intervals. A 9–5 meeting and a 5–6 meeting don’t overlap: an interval includes its start, not its end.
- Zero known bugs. None of the 78,184 tests is skipped or switched off.
See the evidence behind each of these → · Where the Temporal polyfill gets one of these wrong, GMT returns the spec’s answer and reports the defect upstream: Helping fix Temporal →
What this means
Section titled “What this means”| Dimension | GMT | Legacy libraries |
|---|---|---|
| CI executions | 2,345,520 | 386 – 1,209,794 |
| Locales tested | 17, built into every test | 0 – 140 files, tested in isolation from the rest of the API surface |
| Timezones tested | 10 × every public function | 0 – 22 files, tested in isolation; date-fns re-runs its whole suite under 378 time-zone settings |
| Node versions | 22, 24, 26 | 1 – 5 |
| Public functions | 781 | 84 – 246* |
| Time precision | Nanoseconds, exact as bigint | Milliseconds |
| Sentinel contract | "" / null / false / [] | Throws RangeError |
* Public functions and methods, counted from each library’s published TypeScript declarations: every exported function, plus every public method of its exported classes and types. Overloads, aliases and inherited methods count once; constructors, getters and properties do not. date-fns 4.4.0: 246 (245 functions, 1 method); Moment.js 2.31.0: 169 (27 functions, 142 methods); Luxon 3.7.2: 153 (0 functions, 153 methods); Day.js 1.11.23: 128 (16 functions, 112 methods); @internationalized/date 3.12.4: 104 (46 functions, 58 methods); Spacetime 7.17.1: 84 (0 functions, 84 methods). GMT exports functions only.
The table is the point. GMT does not add a few convenience methods to an
existing Date wrapper — it replaces the type system entirely with
TC39 Temporal, then rebuilds the
ergonomic surface on top of that guarantee. Every function takes and returns
ISO 8601 strings,
every zoned value carries its
RFC 9557 time-zone annotation, and
the 17-locale, 10-timezone matrix runs
against the library’s entire public API on every PR, not a sample of it.
That is what 2,345,520 CI executions verify.
The full table, how each figure was measured, and what each library covers are on GMT and the other libraries.
© 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.