Aims. Active galactic nuclei (AGN) often show evidence of photoionized outflows. A major uncertainty in models for these outflows is the distance (R) to the gas from the central black hole. In this paper we use the HST/COS data from a massive multi-wavelength monitoring campaign on the bright Seyfert I galaxy Mrk 509, in combination with archival HST/STIS data, to constrain the location of the various kinematic components of the outflow. Methods. We compare the expected response of the photoionized gas to changes in ionizing flux with the changes measured in the data using the following steps: 1) We compare the column densities of each kinematic component measured in the 2001 STIS data with those measured in the 2009 COS data; 2) We use time-dependent photionization calculations with a set of simulated lightcurves to put statistical upper limits on the hydrogen number density (n H ) that are consistent with the observed small changes in the ionic column densities; 3) From the upper limit on n H , we calculate a lower limit on the distance to the absorber from the central source via the prior determination of the ionization parameter. Our method offers two improvements on traditional timescale analysis. First, we account for the physical behavior of AGN lightcurves. Second, our analysis accounts for the quality of measurement in cases where no changes are observed in the absorption troughs. Results. The very small variations in trough ionic column densities (mostly consistent with no change) between the 2001 and 2009 epochs allow us to put statistical lower limits on R between 100-200 pc for all the major UV absorption components at a confidence level of 99%. These results are mainly consistent with the independent distance estimates derived for the warm absorbers from the simultaneous X-ray spectra. Based on the 100-200 pc lower limit for all the UV components, this absorber cannot be connected with an accretion disc wind. The outflow might have originated from the disc, but based on simple ballistic kinematics, such an event had to occur at least 300 000 years ago in the rest frame of the source.