Abstract Single-cell bacterial sensors have numerous applications in human health monitoring, environmental chemical detection, and materials biosynthesis. Such bacterial devices need not only the capability to differentiate between combinations of inputs, but also the ability to process signal timing and duration. In this work, we present a two-input temporal logic gate that can sense and record the order of the inputs, the timing between inputs, and the duration of input pulses. The temporal logic gate design relies on unidirectional DNA recombination with bacteriophage integrases to detect and encode sequences of input events. When implemented in a chromosomally-modified E. coli strain, we can utilize stochastic single cell responses to predict overall heterogeneous population behavior. We show that a stochastic model can be used to predict final population distributions of this E. coli strain, and thus that final differentiated sub-populations can be used to deduce the timing and duration of transient chemical events.