Industries
The core of GMT is a set of general primitives: zoned arithmetic, real day boundaries, half-open intervals, business calendars. Each industry layer is a small set of functions that name the operation an industry actually performs, built on those primitives so every layer agrees about what a midnight, a day or an elapsed hour is.
Each industry also has an overview page under By industry.
Three things hold across every industry layer:
- Facts come from the caller. A port, airport, terminal or station code is not resolved to a time zone, and a contract term is not looked up by carrier. You pass the IANA zone and the terms; GMT does the time arithmetic. That keeps the library free of registries that go stale.
- Elapsed time and calendar days are different answers. A leg is elapsed hours across whatever DST transition it crosses. A charge is counted in local calendar days at the place the thing sat. The industry functions return both where both matter, and never derive one from the other.
- Every result is a standard string. The same ISO 8601 and RFC 9557 strings as the rest of
the library, so an industry result feeds straight back into
interval/,zoned/or a business calendar.
Layers
Section titled “Layers”- Workforce: hours of work — read a duty log against the limits you state: the operator’s day, sliding and fixed windows, split rests and quotas. Shared by any crew, shift or rota; Transport draws on it.
- GNSS: system time and week rollover — read each satellite system’s clock against UTC, name the week counter and the rollover era, and turn a RINEX navigation week into a date. Draws on the leap-second table.
- Maritime: GNSS time and week rollover — which systems a ship may use, why the log keeps UTC, how long a receiver’s week counter stays right over a ship’s service life, and a leap second in a ship’s record.
- Transport: legs and dwell — add a leg’s transit time to a departure, show an arrival where it lands, and measure dwell in exact hours and local calendar days. Shared by road, rail, sea and air. Its deadlines from an anchor find a cut-off counted back from a departure, a loading or an arrival, pinned to a local time of day and rolled off closures, and tell you whether it has passed.
- Transport: multi-leg scheduling — chain truck, ship and rail legs into one ETA with every handoff an exact instant, check a scheduled connection against the minimum connect time, and time a crossing on the clock that administers it. Built on the legs-and-dwell layer.
- Transport: punctuality and timestamps — measure how late an arrival was in exact time, judge it against a tolerance you state, count a rate, pick the best of planned, estimated, requested and actual timestamps, measure how far an estimate moved, and find the next departure a connection can make. Built on the legs-and-dwell layer.
- Intermodal: free time and demurrage — which clock a charge runs on, which day is free day one, calendar or working days, and the chargeable days and dates behind every count. Built on the transport layer’s day count.
- Intermodal: billing deadlines — the last date to issue, dispute and resolve a demurrage or detention invoice, counted in calendar days from a date you name, with every window a number you pass. Built on the free-time layer’s charged dates.
- Intermodal: B/L dates and multimodal ETA — a bill of lading’s issue, receipt and shipped-on-board dates on the local calendar of the place each happened, and an end-to-end ETA with transit and dwell reported apart. Built on the multi-leg scheduling layer.
- Intermodal: EDI timestamps — read and write the dates and
times in UN/EDIFACT
DTMsegments, X12 elements and EPCIS events, and know for each one whether its offset is stated. An offsetless value stays a local time until you name the zone. - Finance: message timestamps — read and write a FIX
UTCTimestampat the precision its digits state, cut rather than rounded when narrowed, with a second of sixty accepted only for a leap second UTC really inserted. Draws on the leap-second table. - Healthcare: clinical timestamps — read and write HL7 version 2 dates and times, keep a time with no offset local until you name the sender’s zone, and keep a partial date a span.
- Aviation: message times — read, write and check an SSIM schedule
date such as
01JAN26, with month letters that ignore the platform’s language and a century you state. Read a METAR time such as251200Zagainst the time it was received, and a NOTAM validity with itsESTandPERM. Draws on Core only. - Rail: GTFS service days — read, write and check a GTFS stop time
such as
25:35:00, which runs past midnight and stays with its service day. Draws on Transport. - IoT: PTP time — convert a Precision Time Protocol timestamp, which counts TAI, to UTC with the offset the grandmaster announces, and check that offset against the leap-second table. Draws on Core only.
Scenarios
Section titled “Scenarios”Each layer comes with real-world scenarios that show the naive approach breaking beside the GMT approach working, on the same live widget:
- Container dwell: two hours, two days
- A 26-hour rail leg across spring-forward
- Two arrivals, one wall time: the fall-back night
- A Connection Missed at the Spring-Forward Handoff
- Two Days Before Is Not 48 Hours
- A Filing Deadline Anchored to the Wrong Event
- An Estimate Shown as the Actual
- A Delay Across the Fall-Back
- Free time: which day is day one
- Demurrage across a weekend
- Detention is not demurrage
- Invoice a Day Late
- A Re-Bill Anchored on the Wrong Date
- A Dispute Window from a Contract
- A B/L Dated a Day Late
- An ETA That Forgot the Sailing
- A 203 Read as UTC
- ET Is Not an Offset
- The EPCIS Offset Nobody Kept
- A Millisecond Stamp Read as Nanoseconds
- Second Sixty on an Ordinary Day
- An HL7 Time Read as UTC
- A TS Date Read as a Time
- A FHIR Month Padded to Midnight
- An SSIM Month Read in the Wrong Language
- A METAR from Last Month
- PERM Read as a Date
- A GTFS Time Folded into One Day
- A PTP Stamp 37 Seconds Ahead
The mistakes that have hurt people in these layers are collected under Transport mistakes, Intermodal mistakes, Finance mistakes, Healthcare mistakes, Aviation mistakes, Rail mistakes and IoT mistakes.
© 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.