It takes about 2 years for the Earth and Mars to be in the best position for a spacecraft to travel from Earth to Mars.