In this paper, we describe a very versatile numerical model, which can be applied to study the quantum dynamics of an electron wave packet in the presence of external electric and magnetic fields. Detailed numerical analysis is carried out in the paper on the validity of such a model, including (1). comparison with analytical solution in the case of uniform magnetic field, and (2). stringent numerical tests in the case of both electric and magnetic fields. The algorithm presented here is found to be highly accurate, computationally efficient, and numerically stable. It also has the advantage of being able to accommodate arbitrarily complex magnetic field profiles as well as time-varying external fields.