Quantum canonical transformations corresponding to time-dependent diffeomorphisms of the configuration space are studied. A special class of these transformations which correspond to time-dependent dilatations is used to identify a previously unknown class of exactly solvable time-dependent harmonic oscillators. The Caldirola-Kanai oscillator belongs to this class. For a general time-dependent harmonic oscillator, it is shown that choosing the dilatation parameter to satisfy the classical equation of motion, one obtains the solution of the Schr\"odinger equation. A simple generalization of this result leads to the reduction of the Schr\"odinger equation to a second order ordinary differential equation whose special case is the auxiliary equation of the Lewis-Riesenfeld invariant theory. Time-evolution operator is expressed in terms of a positive real solution of this equation in a closed form, and the time-dependent position and momentum operators are calculated.