A $1,800 detention invoice sat on my desk. The carrier was adamant on the phone: your warehouse held my truck for 40 hours. I didn't argue. I pulled up the YMS log and read it back to him, line by line: gate in 6:12 AM, door assigned 6:47, loading complete 9:03, gate out 9:21. The truck spent under three and a half hours inside the yard. The contract allowed two hours of free time. Billable time came to under ninety minutes. We ended up paying just under two hundred dollars. The missing sixteen hundred? That's what timestamps are worth.
Detention is simple in theory: a truck arrives, loading or unloading runs past the free waiting period, and the overtime gets billed per the contract. In practice, nearly every detention fight I've seen in twenty years comes down to two questions: which second does the clock start from, and what proof backs your math. A yard management system earns its keep by nailing those answers down.
Quick terminology: detention is the truck waiting; demurrage is freight overstaying — a container sitting too long at a port. Demurrage belongs to ports and ocean carriers. Detention happens at your gate. This piece is about detention.
Where the Clock Actually Starts
Every truck visit has six timestamps: appointment time, gate in, door assignment, load start, load complete, and gate out. Where free time starts determines most of the invoice.
Carriers love starting the clock at "arrival at the property line" — the driver queued outside the fence for forty minutes, and you get billed for it. Warehouses prefer starting at "backed into the door," pretending the queue never happened. Same truck, same visit, over an hour of difference.
My call: free time starts at gate in. Three reasons. First, gate in is machine-recorded — badge swipe, plate recognition, barrier arm. Nobody fudges it. Second, appointment time is meaningless here: a driver showing up two hours early is his dispatcher's problem; two hours late is his problem too. Third, everything before door assignment is the yard's own scheduling to absorb — counting it means the warehouse pays for its own inefficiency, which is exactly what a YMS is supposed to fix.

But gate in alone isn't enough. A complete chain needs five points: gate in, door assigned, load start, load complete, gate out. Why capture load start and finish? Because some carriers bill "door occupancy" — the trailer sat at the dock for an hour before anyone touched it, and they want that hour. If your YMS only logs gate movements, that stretch is a black box. Load start and finish can be corroborated with dock door sensors or forklift task timestamps; nobody needs to punch a clock by hand.
One distinction contracts usually miss: loaded versus empty. A bobtail rolling in to grab an empty trailer is a thirty-minute job — giving it the same free time as a live load is a giveaway. A 3PL client of mine in Ontario, California paid five figures a month in detention during peak season, and part of it was empty-trailer pickups the contract never separated out. Once a charge lands in the "we'll figure it out later" bucket, you pay it.
Whoever Holds the Data Wins the Argument
Timestamps have a trap: the source. The same truck can show three different times in three systems — the driver's handwritten log, the carrier's dispatch GPS, your gate system. When it comes to a fight, the hardest data source wins.
The ranking is simple. Machine-captured YMS data — plate readers, barrier arms, RFID — is the hardest; machines don't lie. Guard-logged manual entries come second; at least a third party witnessed them. Driver-reported times are the softest — I've seen arrival times nudged back a full hour on paper logs.
The trade-off is real. Automated gate capture costs money, and a small yard may balk at the price. But do the math: if timestamp evidence kills one or two bogus invoices a year, the hardware pays for itself. More importantly, without your own data source, you negotiate from permanent weakness — the carrier's time is the time, and all you can do is haggle.
This isn't small money either. A federal study years back pegged detention's annual cost to the U.S. trucking industry at over a billion dollars in lost productivity. For carriers, wheels not turning is money burning, so they fight for every detention dollar. For warehouses, every fuzzy invoice is margin walking out the gate. Both sides want clean books; what's usually missing is a data source both sides accept.
There's a flip side, and I'll be honest about it: fine-grained data exposes your own problems too. Forty minutes to assign a door. A shift change that idled a dock for half an hour. Timestamps don't hide that. Some warehouses install a YMS and then never use the data against a carrier — because the data would show they owe more than the invoice. My advice: use the data internally first. Get your own operation inside free time, then take the receipts to the carrier. Data inward before data outward.
Reconcile Monthly, and Reconcile Data Before Money
Reconcile detention monthly. Don't let a carrier stack three months into one lump-sum surprise. A good reconciliation template has five elements: the full timestamp chain per load, the free-time allowance with its contract clause number, the math showing billable minutes, the rate with its contract reference, and a dispute window — how many days after invoicing a challenge still counts, after which the invoice stands.
Each load should read as one row: load 88412 — gate in 06:12, door 06:47, load start 07:05, load end 09:03, gate out 09:21, yard time 3h 09m, free time 2h 00m, billable 1h 09m at the rate in clause 4.2. When both sides look at the same row, there's nothing left to argue about except arithmetic.
Borrow a public precedent. In 2024, the U.S. Federal Maritime Commission finalized its demurrage and detention billing rule: invoices within 30 calendar days, disputes within 30 days. It governs ocean D&D, not your warehouse gate — but "invoice in 30, dispute in 30" is a rhythm worth writing into your carrier contracts. The longer an invoice sits, the fuzzier everyone's memory gets, and your timestamp advantage decays.
Hold to an order of operations: timestamps first, free-time math second, rates last. If the timestamps don't line up, the rest is theater. Plenty of carrier invoices arrive with no time detail at all — just a total. Send those back and make them reissue on your template. Carriers willing to show their timestamps usually have cleaner invoices anyway.
One more detail: free time doesn't have to be one number all year. A flat standard means peak season — when a three-hour queue is normal — becomes a fixed monthly penalty. Negotiate seasonal terms instead: standard free time off-peak, relaxed in peak, or appointment-based scheduling with shared overtime risk. Carriers hate idle trucks in peak season too; that's when you have leverage.
Before your next carrier negotiation, three lines worth memorizing:
Line one: "Free time starts at gate in, per my YMS timestamps — put it in the contract." Nail down the start point and the data source in one move; everything else rests on it.
Line two: "Every rate, free-time allowance, and overtime rule maps to a contract clause number — no clause number on the invoice, no payment." Force every dollar to trace to a written term, and the fuzzy invoices dry up on their own.
Line three: "Invoices within 30 days, disputes within 30 days, then it's final — in the contract." Time is the best evidence preservative; after too long, nobody can prove anything.
Detention isn't money you should never pay. When a truck waits at your gate, the driver's time is a real cost, and fair invoices deserve prompt payment. But not one dollar more than owed — and "owed" can only mean one thing: timestamps in black and white, backed by contract terms. A YMS isn't really software you're buying. It's your seat at the negotiating table.






