We present ellipsometry data of the dielectric function of wurtzite ZnO in a wide energy range ͑2.5-32 eV͒. The ordinary and extraordinary components show a strong anisotropy above 10 eV, a feature for which ZnO deviates from the other II-VI wurtzite compounds. With the aid of ab initio calculations, performed within many-body perturbation theory ͑MBPT͒ and within time-dependent density-functional theory ͑TDDFT͒, we analyze the origin of the measured optical structures. TDDFT, with the use of a static long-range exchangecorrelation kernel, proves to be a cheaper computational tool than MBPT to yield a good description of the whole spectrum. Theoretical results for the zinc-blende phase are also presented.