We derive an approximate local density functional for the exchange-correlation energy to be used in density-functional calculations of two-dimensional systems. In the derivation we employ the Colle-Salvetti wave function within the scheme of Salvetti and Montagnani [Phys. Rev. A 63, 052109 (2001)] to satisfy the sum rule for the exchange-correlation hole. We apply the functional to the two-dimensional homogeneous electron gas as well as to a set of quantum dots and find a very good agreement with exact reference data.