The vibronic structure of the S0→S1 and the S0→S2 electronic transitions of acetylene is studied theoretically based on an ab initio quantum-dynamical approach. The underlying potential-energy surfaces and transition dipole moment functions are obtained from high-level multireference calculations, including the Davidson correction. Ensuing quantum-dynamical simulations rely on the wave-packet propagation method, using grid techniques, and including three nuclear degrees of freedom (C-C stretching and both HCC bending modes for J=0). The importance of strong anharmonicity is assessed, especially for the S2 excited state with its unusual potential-energy surface. Good overall agreement with the experimental UV absorption spectrum of acetylene is achieved in the range of 6-8 eV.