Contact geometry allows to describe some thermodynamic and dissipative systems. In this paper we introduce a new geometric structure in order to describe time-dependent contact systems: cocontact manifolds. Within this setting we develop the Hamiltonian and Lagrangian formalisms, both in the regular and singular cases. In the singular case, we present a constraint algorithm aiming to find a submanifold where solutions exist. As a particular case we study contact systems with holonomic time-dependent constraints. Some regular and singular examples are analyzed, along with numerical simulations.