On time-dependent Hamiltonian realizations of planar and nonplanar systems