The medial entorhinal cortex (MEC) is known to contain spatial encoding neurons that likely contribute to encoding spatial aspects of episodic memories. However, little is known about the role MEC plays in encoding temporal aspects of episodic memories, particularly during immobility. Here using a virtual 'Door Stop' task for mice, we show that MEC contains a representation of elapsed time during immobility, with individual time-encoding neurons activated at a specific moment during the immobile interval. This representation consisted of a sequential activation of time-encoding neurons and displayed variations in progression speed that correlated with variations in mouse timing behavior. Time- and space-encoding neurons were preferentially active during immobile and locomotion periods, respectively, were anatomically clustered with respect to each other, and preferentially encoded the same variable across tasks or environments. These results suggest the existence of largely non-overlapping subcircuits in MEC encoding time during immobility or space during locomotion.