We extend Angluin's algorithm for on-line learning of regular languages to the setting of timed transition systems. More specifically, we describe a procedure for inferring systems that can be described by event-recording automata by asking a sequence of membership queries (does the system accept a given timed word?) and equivalence queries (is a hypothesized description equivalent to the correct one?). In the inferred description, states are identified by sequences of symbols together with timing information. The number of membership queries is polynomially in the region graph and in the biggest constant of the automaton to learn.