In memory, our continuous experiences are broken up into discrete events. Boundaries between events are known to influence the temporal organization of memory. However, how and through which mechanism event boundaries shape temporal order memory (TOM) remains unknown. Across four experiments, we show that event boundaries exert a dual role: improving TOM for items within an event and impairing TOM for items across events. Decreasing event length in a list enhances TOM, but only for items at earlier local event positions, an effect we term the local primacy effect. A computational model, in which items are associated to a temporal context signal that drifts over time but resets at boundaries captures all behavioural results. Our findings provide a unified algorithmic mechanism for understanding how and why event boundaries affect TOM, reconciling a long-standing paradox of why both contextual similarity and dissimilarity promote TOM.