The impact of a non-universal initial mass function on the star formation histories of early-type galaxies