  Context: The formation and evolution of disk galaxies are long standing
questions in Astronomy. Understanding the properties of globular cluster
systems can lead to important insights on the evolution of its host galaxy.
Aims: We aim to obtain the stellar population parameters - age and metallicity
- of a sample of M31 and Galactic globular clusters. Studying their globular
cluster systems is an important step towards understanding their formation and
evolution in a complete way. Methods: Our analysis employs a modern
pixel-to-pixel spectral fitting technique to fit observed integrated spectra to
updated stellar population models. By comparing observations to models we
obtain the ages and metallicities of their stellar populations. We apply this
technique to a sample of 38 globular clusters in M31 and to 41 Galactic
globular clusters, used as a control sample. Results: Our sample of M31
globular clusters spans ages from 150 Myr to the age of the Universe.
Metallicities [Fe/H] range from -2.2 dex to the solar value. The
age-metallicity relation obtained can be described as having two components: an
old population with a flat age-[Fe/H] relation, possibly associated with the
halo and/or bulge, and a second one with a roughly linear relation between age
and metallicity, higher metallicities corresponding to younger ages, possibly
associated with the M31 disk. While we recover the very well known Galactic GC
metallicity bimodality, our own analysis of M31's metallicity distribution
function (MDF) suggests that both GC systems cover basically the same [Fe/H]
range yet M31's MDF is not clearly bimodal. These results suggest that both
galaxies experienced different star formation and accretion histories.
