Local times of Gaussian random fields and SPDEs