In this paper a general parabolic problem is considered and discretized by the discontinuous Galerkin (DG) method in time and, in general, in space. Optimal a priori error estimates in space as well as in time are derived and applied to the heat equation and to a nonlinear convection-diffusion equation.