When to test

Jenna
When is the best time to take a pregnancy test? And does it matter if it's not first thing in the morning?thanks !