Time is a central dimension against which perception, action, and cognition play out. From anticipating when future events will happen to recalling how long ago previous events occurred, humans and animals are exquisitely sensitive to temporal structure. Empirical evidence seems to suggest that estimating time prospectively (i.e., in passing) is qualitatively different from estimating time in retrospect (i.e., after the event is over). Indeed, computational models that attempt to explain both prospective and retrospective timing assume a fundamental separation of their underlying processes. We, in contrast, propose a new neurocomputational model of timing, the unified temporal coding (UTC) model that unifies prospective and retrospective timing through common principles. The UTC model assumes that both stimulus and timing information are represented inside the same rolling window of input history. As a consequence, the UTC model explains a wide range of phenomena typically covered by specialized models, such as conformity to and violations of the scalar property, one-shot learning of intervals, neural responses underlying timing, timing behavior under normal and distracting conditions, common capacity limits in timing and working memory, and how timing depends on attention. Strikingly, by assuming that prospective and retrospective timing rely on the same principles and are implemented in the same neural network, a simple attentional gain mechanism can resolve the apparently paradoxical effect of cognitive load on prospective and retrospective timing. (PsycInfo Database Record (c) 2025 APA, all rights reserved).