With the aim to solve the time-dependent Schr ̈odinger equation associated to a time-dependent non-Hermitian Hamiltonian, we introduce a unitary transformation that maps the Hamiltonian to a time-independent PT-symmetric one. Consequently, the solution of time-dependent Schrödinger equation becomes easily deduced and the evolution preserves the C(t)PT -inner product, where C(t) is a obtained from the charge conjugation operator C through a time dependent unitary transformation. Moreover, the expectation value of the non-Hermitian Hamiltonian in the C(t)PT normed states is guaranteed to be real. As an illustration, we present a specific quantum system given by a quantum oscillator with time-dependent mass subjected to a driving linear complex time-dependent potential.