We present a second-quantization based atomic-orbital method for the computation of
time-dependent response functions within Hartree-Fock and Kohn-Sham density-functional
theories. The method is suited for linear scaling. Illustrative results are presented for excitation
energies, one- and two-photon transition moments, polarizabilities, and hyperpolarizabilities for
hexagonal BN sheets with up to 180 atoms.