The formation of cold dark matter haloes – II. Collapse time and tides