Test before your water change. Its when your tank is at its 'worst', and the water change will dilute any possible issues.
As far as TOD, I usually turn my lights on a couple hours before I test, to try and simulate 'day' conditions.
But if I test with the lights off, I know my pH is going to be low. I've kind of figured out what the correction is.