A Connection Missed at the Spring-Forward Handoff
A Connection Missed at the Spring-Forward Handoff
A truck leaves Amsterdam at 08:00 on 29 March 2024 on a 46-hour run to the London port. Handling there takes two hours. The ship to Tokyo is published to sail at 07:30 on 31 March. Is the connection made?
The naive approach
// The naive approach: one UTC offset per place, from a table
const OFFSET_HOURS = { "Europe/London": 0 }; // London, as the table was built in winter
const departed = Date.parse("2024-03-29T08:00:00+01:00"); // Amsterdam, 08:00
const arrived = departed + 46 * 36e5; // 2024-03-31T05:00:00.000Z
const toLocal = (ms) => new Date(ms + OFFSET_HOURS["Europe/London"] * 36e5).toISOString().slice(0, 16);
toLocal(arrived); // "2024-03-31T05:00"
const ready = arrived + 2 * 36e5; // two hours of handling: "2024-03-31T07:00" local
const sails = Date.parse("2024-03-31T07:30:00Z") - OFFSET_HOURS["Europe/London"] * 36e5; // 07:30 local, by the table
ready <= sails; // true — "made, with 30 minutes to spare"Watch it break
The naive approach silently produces wrong results — there is no GMT equivalent to demonstrate because the failure is not using GMT.
Why
A fixed offset is a place's offset at one moment. The table's +00:00 was London's offset when the truck left. Clocks sprang forward at 01:00 on 31 March, and the truck arrived at 05:00Z, which is 06:00 BST. The naive code reads the arrival and the ship's published 07:30 through that same stale offset, so the handoff looks 30 minutes early. In fact the cargo is ready at 08:00, and the ship sailed at 07:30. `scheduleDelivery` keeps every handoff an exact instant. It reads the ship's published time in the port's own zone. It treats a departure before the arrival plus the handling time as a missed connection, and returns `null` rather than a negative wait.
The gmt approach
import { scheduleDelivery } from "@northguild/gmt/transport";
const truck = { departure: "2024-03-29T08:00:00+01:00[Europe/Amsterdam]", duration: "PT46H", timeZone: "Europe/London", dwellAfter: "PT2H", mode: "truck" };
const ship = { departure: "2024-03-31T07:30:00[Europe/London]", duration: "P11D", timeZone: "Asia/Tokyo", mode: "ship" };
const laterShip = { departure: "2024-03-31T08:30:00[Europe/London]", duration: "P11D", timeZone: "Asia/Tokyo", mode: "ship" };
scheduleDelivery([truck]);
// { eta: "2024-03-31T06:00:00+01:00[Europe/London]", legTimes: [{ arrival: "2024-03-31T05:00:00Z", localArrival: "2024-03-31T06:00:00+01:00[Europe/London]", dwellAfter: "PT2H", mode: "truck" }] } — 06:00, not 05:00
scheduleDelivery([truck, ship]);
// null — the ship sails inside the two-hour handoff: a missed connection
scheduleDelivery([truck, laterShip]);
// { eta: "2024-04-11T16:30:00+09:00[Asia/Tokyo]",
// legTimes: [{ arrival: "2024-03-31T05:00:00Z", localArrival: "2024-03-31T06:00:00+01:00[Europe/London]", dwellAfter: "PT2H", mode: "truck" },
// { arrival: "2024-04-11T07:30:00Z", localArrival: "2024-04-11T16:30:00+09:00[Asia/Tokyo]", dwellAfter: "PT0S", mode: "ship" }] } — a half hour later, the connection holdsSame widget, working
Open the handoff in the Connection Checker and slide the handling time down: at 90 minutes the ship sails exactly when the cargo is ready, and equal passes. At 91 it is missed. Or open the whole journey in the Delivery Scheduler and change the ship’s departure to 07:30. The full rules are in Transport: Multi-leg Scheduling.
© 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.