Back to blogs

    What Is Demurrage in Freight? Time Zones Are Critical to Avoid Penalty

    By TransportOne Editorial Team•October 11, 2026•7 min read
    North gate of the New York container terminal on Staten Island

    Your audit says the container had one more day of demurrage free time. The carrier's invoice says it didn't. Demurrage free time is the number of days a container may sit at the terminal before daily charges start. Demurrage charges are the daily fees a carrier or terminal bills once a container stays at the terminal past that free time. Both sides here are reading the same gate-out event, and their answers sit exactly one day apart.

    The gap is rarely a disagreement about the tariff. Usually it's a truncation. An instant in time became a date in the wrong zone, and every count downstream moved with it. The line responsible is one expression, and it's never thrown an error in its life.

    How Can a Date Error Affect Demurrage Charges?

    A container event arrives as an instant, normalised to UTC by whoever supplied it. A tariff's demurrage calculation doesn't count instants. It counts days on the terminal's local calendar, starting and stopping at local midnight.

    One event, two dates

    Terminal49's documentation states that "Event timestamps are stored and returned in UTC," and that each one should carry a matching IANA timezone for conversion. Their worked example uses a pod_arrived_at of 2022-12-22T07:00:00Z with a pod_timezone of America/Los_Angeles. Rendered locally, that's 2022-12-21T23:00:00 Pacific Standard Time.

    Call new Date(ts).toISOString().slice(0, 10) and you get the twenty-second. Resolve the same instant in the port's zone and you get the twenty-first.

    The same defect in other languages

    SQL hits it when a timestamptz column meets DATE() under a UTC session. Python hits it when a tz-aware datetime meets .date() with no astimezone call before it.

    What the shifted day costs

    Move the availability date by one and the whole free time window slides with it. Move the gate-out date by one and the billable count changes directly. On ACL's published tariff, import demurrage on a dry van at Norfolk opens at $135 a day and reaches $245 beyond day twenty. Charges "will commence at 00:01 hours on the first day after expiration of free time." Your arithmetic has to match that clock on every box.

    Why Do Date and Time Errors Go Undetected?

    The bug reaches production because it usually cancels itself. When both ends of the window are truncated in UTC under the same offset, the difference between them comes out right even though neither date is. A fixture built from two clean afternoon timestamps at one port passes, and it keeps passing.

    Four ordinary conditions break the cancellation:

    • One end falls within the offset of local midnight. At a US West Coast terminal in winter, every event between 00:00 and 08:00 UTC belongs to the previous local day.
    • The two ends come from different feeds. Carrier EDI, a terminal portal and a visibility provider don't agree on whether an offset is included, and a timestamp string without one is a guess.
    • The event has no resolvable location. Terminal49 documents this case plainly: when the timezone is null, "Terminal49 takes the timestamp as given from the source and parses it in UTC." If that source was emitting local time, the instant is now wrong by the full offset, and nothing downstream can detect it.
    • The window crosses a daylight saving transition, covered next.

    None of these raise an exception. Each returns a well-formed, plausible count that's one lower than the carrier's. That single day changes the demurrage fees you think you owe, and nothing flags it. When we've traced a disputed day back through a shipper's pipeline, it has usually ended at a conversion like this, sitting in code nobody had touched in years.

    A day isn't 86,400 seconds

    The second version is arithmetic. Subtract two instants, divide by 86,400,000, take the floor, and you've measured elapsed time instead of counting calendar days.

    Daylight saving and the short window

    Those quantities diverge twice a year. United States clocks sprang forward on March 8, 2026 and fall back on November 1, 2026. A five day window containing the March transition runs 119 hours. Floor that into days and it returns four.

    Your audit now believes a free day went unused, and the dispute you raise on it is wrong before the carrier opens the email. November runs the other way and is almost always harmless, which is why the March defect survives the eight months between them.

    Calendar days and business days

    Calendar days have to be counted on a calendar, and that's how demurrage charges are calculated once free time ends. Render both instants in the terminal's zone, take their civil dates, and count the boundaries between them. Hapag-Lloyd's Detention and Demurrage Guide for the USA, dated May 2026, specifies that detention and demurrage apply "on a calendar / continuous day basis after free time has expired."

    Free time itself often follows a different rule. ACL grants Norfolk five business days of import free time, then switches to a calendar count once charges begin. One window carries two counting rules, and the business-day rule needs a holiday list keyed to local dates.

    Your timezone database expires

    The third source of demurrage billing errors catches teams who got the first two right. Zone rules are data. That data changes, and a build pins it.

    Morocco and Tanger Med

    The IANA time zone database recorded in its 2026c release that "Morocco plans to move back to permanent UTC, without daylight saving time transitions, on 2026-09-20 at 02:00." The tz mailing list traced the change to decree 2.26.530. Africa/Casablanca governs Tanger Med. An image built before that release resolves terminal local time an hour off for every container handled since September 20, which is enough to flip the date on any event near midnight.

    Canada's changes in the same year

    Canada contributed three more:

    • 2026b carried British Columbia to permanent UTC-07.
    • 2026c carried Alberta to permanent UTC-06 after a final clock change on March 8.
    • 2026d added the Northwest Territories.

    A box discharged at a coastal terminal and billed at a rail ramp runs on two clocks at once. ACL's tariff also starts rail ramp counting on the first business day after grounding, which is later than vessel discharge.

    Pinning tzdata is correct engineering. If you pin it and never advance it, you get slow data corruption with no error message attached.

    Where the wrong day lands

    None of this would matter if the number stayed inside your system. Under 46 CFR 541.6, a demurrage or detention invoice has to state the allowed free time in days, the start and end dates of that free time, and the specific dates charged. Dispute one and you file a competing version of those exact fields, under your company's name.

    Section 541.7 adds a second date that has to be right. The billing party has 30 calendar days from the date the charge was last incurred to issue its invoice, and missing that window removes the obligation to pay. Get the zone wrong on a charge incurred late in the terminal's evening and a late invoice reads as timely. Or a timely one reads as late, and you short pay something you owe. We've written about why demurrage day counts belong in a deterministic engine, and this is the same principle one layer down.

    Counting the day correctly means replacing six defaults:

    What the code usually doesWhat the tariff requires
    Truncates the UTC instant to a dateRenders the instant in the terminal's IANA zone, then takes the civil date
    Applies one zone across the whole shipmentResolves a zone per event, because the discharge terminal and the rail ramp differ
    Divides elapsed milliseconds by 86,400,000Counts the midnight boundaries crossed between two civil dates
    Accepts an offset-free timestamp as UTCTreats an offset-free timestamp as missing data
    Freezes zone rules at image buildTracks tzdata as a dependency with a release cadence
    Takes one feed as the source of the gate-outCorroborates the event across two independent sources before counting it

    In a demurrage invoice audit, Penny is never handed a date. She gets an instant, the zone it resolved in, and the source that supplied it, and the count comes back from an engine applying the governing tariff's own calendar. Container milestone tracking from Chase supplies the discharge, availability and gate events. That's why the zone travels attached to the event and is never inferred later from a port code.

    Two queries to run before your next dispute

    You don't need a vendor in the room for either. Start with the riskiest containers: pull ten whose last free day fell within two hours of local midnight at the terminal, and compare your count against the carrier's, line by line.

    Then re-run a week of counts from early March and early November. Any window spanning the transition that returns a day short is the floor-divide defect.

    If either query finds a gap, ask a follow-up of your data team: which timestamps in the warehouse carry an offset? The ones that don't are being guessed at, and they're often where the gap came from. Shippers moving high-volume retail imports through US ports have the most boxes exposed to each wrong day.

    If you'd like to watch a month of your demurrage invoices recomputed against each terminal's own clock, book a walkthrough and we'll go through them event by event.

    Frequently asked questions

    How do date errors affect demurrage charges?
    A UTC timestamp truncated to a date can land on the wrong local day at the terminal. Move the availability date by one and the whole free time window slides with it; move the gate-out date by one and the billable count changes directly. On ACL's published Norfolk tariff, that day costs $135 to $245 per dry van. A wrong date also lands in any dispute you file against the invoice's free time and charge dates.
    How do you calculate container demurrage fees?
    Count free time under the governing tariff's own rule, which may be business days, as with ACL's five business days at Norfolk. Charges then start on the first day after free time expires and run on a calendar basis, at the tariff's daily rate for that day band. Count days by rendering each event in the terminal's time zone and counting the midnight boundaries between civil dates, not by dividing elapsed milliseconds.
    How does daylight saving time affect shipping schedules?
    Daylight saving shifts local clock time by an hour, so free time windows and cutoffs computed in local time can shorten or lengthen by that hour. A five day window containing the March transition runs 119 hours, and floor-dividing it returns four days. A date derived from UTC can also move a day for events near local midnight.
    Which time zone should be used to calculate demurrage free time?
    Use the IANA time zone of the terminal or rail ramp where each event happened, resolved per event. A shipment discharged at a coastal terminal and billed at a rail ramp can run on two clocks. Treat timestamps without an offset as missing data instead of assuming UTC.

    See it on your freight

    Stop Overpaying On Freight Invoices

    Penny checks every invoice against your contracts and what the shipment actually did, then disputes what doesn’t hold up. You pay 30% of what she saves you, and nothing if she saves nothing.

    See how Penny works

    Found this useful? Share it with your team.

    Share on LinkedIn