What happens if you have sex the day before your ovulation day?

Destiny

Could someone be pregnant if they had sex the day before ovulation ? If so, when is the best time to take a pregnancy test?