The real answer is... Anytime! However, one should always pay attention to their body to find what the optimum time for them is. The healthiest options for working out are early morning and late afternoon.
It is a great way to energize your day. By exercising early, you will give yourself that boost that you may normally need from caffeine. In addition, you cannot skip a workout if you have already done it! The downside for some people is afternoon sleepiness that can be remedied by a nap or a ten minute walk.
The body is warmed up for the day. You may be able to experience your optimum challenge at this time of day; your best run time, fastest swim or heaviest weight. For some, the negative can be a tendency to skip the workout when you have had a busy day.
Proceed with caution if you prefer to workout before bedtime. It can interfere with your sleep patterns and cause a cycle of fatigue that drains your workout of energy and degrades muscle tone.
This said, there is never a really ‘bad” time to exercise; it is always positive. If you are not sure what works best for you, experiment for two weeks and see how you feel.