External photoevaporation of circumstellar discs constrains the time-scale for planet formation