We model the evolution of the snow line in a protoplanetary disc. If the magnetorotational instability (MRI) drives turbulence throughout the disc, there is a unique snow line outside of which the disc is icy. The snow line moves closer to the star as the infall accretion rate drops. Because the snow line moves inside the radius of the Earth's orbit, the formation of our water-devoid planet is difficult with this model. However, protoplanetary discs are not likely to be sufficiently ionized to be fully turbulent. A dead zone at the mid-plane slows the flow of material through the disc and a steady state cannot be achieved. We therefore model the evolution of the snow line also in a time-dependent disc with a dead zone. As the mass is accumulating, the outer parts of the dead zone become self-gravitating, heat the massive disc and thus the outer snow line does not come inside the radius of the Earth's orbit, contrary to the fully turbulent disc model. There is a second, inner icy region, within the dead zone, that moves inwards of the Earth's orbit after a time of about 10 6 yr. With this model there is sufficient time and mass in the disc for the Earth to form from water-devoid planetesimals at a radius of 1 au. Furthermore, the additional inner icy region predicted by this model may allow for the formation of giant planets close to their host star without the need for much migration.