We introduce a new discontinuous Galerkin approach for time integration. On the basis of the method of weighted residual, numerical quadratures are employed in the finite element time discretization to account for general nonlinear ordinary differential equations. Many different conditions, including explicit, implicit, and symplectic conditions, are enforced for the test functions in the variational analysis to obtain desirable features of the resulting time-stepping scheme. The proposed discontinuous Galerkin approach provides a unified framework to derive various time-stepping schemes, such as low-order one-step methods, Runge–Kutta methods, and multistep methods. On the basis of the proposed framework, several explicit Runge–Kutta methods of different orders are constructed. The derivation of symplectic Runge–Kutta methods has also been realized. The proposed framework allows the optimization of new schemes in terms of several characteristics, such as accuracy, sparseness, and stability. The accuracy optimization is performed on the basis of an analytical form of the error estimation function for a linear test initial value problem. Schemes with higher formal order of accuracy are found to provide more accurate solutions. We have also explored the optimization potential of sparseness, which is related to the general compressive sensing in signal/imaging processing. Two critical dimensions of the stability region, that is, maximal intervals along the imaginary and negative real axes, are employed as the criteria for stability optimization. This gives the largest Courant–Friedrichs–Lewy time steps in solving hyperbolic and parabolic partial differential equations, respectively. Numerical experiments are conducted to validate the optimized time-stepping schemes.