This paper is concerned with the numerical approximation to the one-dimensional Cahn-Hilliard equation with time periodic solution. We adopt the implicit Euler method and the spectral Galerkin method for the temporal and spatial discretization, respectively. Then the error estimates are proved for both the semi-discrete and the fully discrete schemes. Numerical experiments are carried out to confirm our theoretical results.