The optimal time to get the flu vaccine is before the flu season starts, typically in the early fall. The CDC advises getting vaccinated by the end of October, although getting vaccinated later can still offer protection. Immunity from the vaccine takes about two weeks to develop, so early vaccination is beneficial.