Pregnancy Test

When is the best time to take a pregnancy test in order to get the most accurate result?