  We show how the existence of a relation between the star formation rate and
the gas density, i.e. the Kennicutt-Schmidt law, implies a continuous accretion
of fresh gas from the environment into the discs of spiral galaxies. We present
a method to derive the gas infall rate in a galaxy disc as a function of time
and radius, and we apply it to the disc of the Milky Way and 21 galaxies from
the THINGS sample. For the Milky Way, we found that the ratio between the past
and current star formation rates is about 2-3, averaged over the disc, but it
varies substantially with radius. In the other disc galaxies there is a clear
dependency of this ratio with galaxy stellar mass and Hubble type, with more
constant star formation histories for small galaxies of later type. The gas
accretion rate follows very closely the SFR for every galaxy and it dominates
the evolution of these systems. The Milky Way has formed two thirds of its
stars after z=1, whilst the mass of cold gas in the disc has remained fairly
constant with time. In general, all discs have accreted a significant fraction
of their gas after z=1. Accretion moves from the inner regions of the disc to
the outer parts, and as a consequence star formation moves inside-out as well.
At z=0 the peak of gas accretion in the Galaxy is at about 6-7 kpc from the
centre.
