We present simple solutions of first-passage and first-exit time problems for general moving boundaries and general Itô processes in one dimension, including diffusion processes with convection. The approach uses eigenfunction expansion, despite the boundary time-variability that, until now, has been an obstacle for spectral methods. The eigenfunction expansion enables the analytical reduction of the problem to a set of equivalent ordinary differential equations, which can be input directly to readily available solvers. The method is thus suitable as a basis for efficient numerical computation. We illustrate the technique by application to Wiener and Ornstein–Uhlenbeck processes for a variety of moving boundaries, including cases for which exact results are known.