Thermodynamics of Time-Dependent Open Quantum Systems