You should ideally apply four weeks before your travel date, even though the visa might take only a few days to be processed. This is to make sure that you have plenty of time to make amends in case there are glitches in the process.