The aim of this paper is to generalize the classical theorems on averaging of differential equations. We focus on dynamic equations on time scales and prove both periodic and nonperiodic version of the averaging theorem, as well as a related theorem on the existence of periodic solutions.