You can apply 6 months before your intended date of travelling to Spain.