When's he best time to test?

I know first morning urine is he best to use but is it ok to take it around the times of 2-4 am or when I first wake up at around 7am??