Ideally, you should have the yellow fever vaccination at least 10 days before your travel. This will allow enough time for your body to develop protective antibodies against the yellow fever infection.
Know more: https://www.travel-doc.com/yellow-fever-vaccination-derby/