Skip to content

Why GMT?

  • The core functions, which every industry uses.

@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.

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−5

    A 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 error

    01: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 1

    Months 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 date

    Year, 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 place

    A Date handed to a function can be changed underneath you. There is no read-only Date.

  • Fault
    "09:00 every Tuesday, Tokyo"not representable

    A 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 answers

    Parsing 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, renamed

    Most 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 failing

    DST 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 spec

    With 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.

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.

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.

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.

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.

CI timezones under test

10 timezones spanning UTC−11 to UTC+13:45. Hover a dot for the current local time in ISO 8601. Times refresh every second via Temporal.

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.

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 →

DimensionGMTLegacy libraries
CI executions2,345,520386 – 1,209,794
Locales tested17, built into every test0 – 140 files, tested in isolation from the rest of the API surface
Timezones tested10 × every public function0 – 22 files, tested in isolation; date-fns re-runs its whole suite under 378 time-zone settings
Node versions22, 24, 261 – 5
Public functions78184 – 246*
Time precisionNanoseconds, exact as bigintMilliseconds
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.

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.