You can get travel insurance the day before you travel. It is not a lengthy process and dependant on your provider, most likely will kick in as soon as you have purchased it.
It is advised by many providers that you purchase your insurance before you travel.