To navigate their environments effectively, animals frequently integrate distance or time information to seek food and avoid threats. This integration process is thought to engage hippocampal neurons that fire at specific distances or times. Using virtual-reality environments, we uncovered two previously unknown functional subpopulations of CA1 pyramidal neurons that encode distance or time through a novel two-phase coding mechanism. The first subpopulation exhibits a collective increase in activity that peaks at similar times, marking the onset of integration; subsequently, individual neurons gradually diverge in their firing rates due to heterogeneous decay rates, enabling time encoding. In contrast, the second subpopulation initially decreases its activity before gradually ramping up. Closed-loop optogenetic experiments revealed that inactivating somatostatin-positive (SST) interneurons disrupts the first subpopulation, behaviorally impairing integration accuracy, while inactivating parvalbumin-positive (PV) interneurons disrupts the second subpopulation, impairing behavior during integration initiation. These findings support the conclusion that SST interneurons establish an integration window, while PV interneurons generate a reset to reinitiate integration. This study elucidates parallel neural circuits that facilitate distinct aspects of distance or time integration, offering new insights into the computations underlying navigation and memory encoding.