An extraordinary strong magnetic field, eB0≈1018 Gauss, is expected to be generated in non-central ultrarelativistic heavy ion collisions and it is envisaged to induce several effects on hot QCD matter including the possibility of local parity and local charge conjugation and parity symmetry violations. A direct signature of such e.m. fields and a first quantitative measurement of its strength and lifetime are still missing. We point out that both the mean value of leptonic invariant mass of Z0 boson, reconstructed by its decaying lepton pairs, and the relative width are modified in relativistic heavy ion collisions due to the presence of strong initial e.m. fields. We propose a measurement of the leptonic invariant mass of Z0 as a novel probe of the strength of the By. Both shifts could be up to about few hundred MeV and are found to depend on the integral of By over the time duration quadratically (approximate). Hence it provides a novel and clear probe of electromagnetic fields, which can be tested experimentally.