A mechanism to store and recall time intervals ranging from hundreds of milliseconds to tens of seconds is described. The principle is based on beat frequencies between oscillating elements; any small group of oscillators codes specifically for an interval equal to the lowest common multiple of their oscillation periods. This mechanism could be realized in the nervous system by an output neuron, excited by a group of pacemaker neurons, and able to select via a Hebbian rule a subgroup of pacemaker cells to encode any given interval, or small number of intervals (for example, a pattern of pulses). Recall could be achieved by resetting the pacemaker cells and setting a threshold for activation of the output unit. A simulation is described and the main features of such an encoding scheme are discussed.