A numerical method is presented for calculating unsteady two-dimensional laminar and turbulent boundary layers with fluctuations in external velocity. The method used an eddy-viscosity formulation to model the Reynolds shear stress term appropriate to turbulent flow and an efficient two-point finite-difference method to solve the governing boundary-layer equations. The method is used to calculate phase angles between the wall shear stress and an oscillating external laminar boundary layer over a flat plate. The results are in excellent agreement with the analytic solutions of Lighthill for the high- and low-frequency limits and provide information in the region between. Similar calculations for turbulent flows are compared with experimental data and the method shown to be more precise than previously described attempts to represent flows of this type. The agreement between calculations and measurements is imperfect but probably within the resolution of the experiments and adequate for engineering purposes.