The question about food you are asking is fairly hard to answer, for the following reasons. Exercising before you eat depends on the time of day, and how long it has been since your last meal/snack. For example, in the morning, if you exercise before breakfast, you haven't eaten since you evening meal, or any subsequent snacks before sleeping. As energy is still used while asleep, you burn a lot of this energy and your own stores (as glycogen from muscles and the liver). This means you will be running on less energy in the morning, so eating beforehand would appear beneficial.
However, there is a disadvantage to eating then exercising. With food digesting in your stomach and, after a few hours, in the intestine, the food moves around more whilst you exercise. In sports such as swimming and cycling, you may not notice it that much, but when you are running, the more common running style involves lots of up and down movement. The food bounces around the gut, causing stitches (abdomen pain during exercise) and nausea, which could eventually lead to vomiting.
So, your time of 9pm would actually seem like an ideal time to exercise. Providing you have had your evening meal by 7-7:30 pm, you should digest a fair amount of it by then (depending on how heavy it is), and exercise should be ok. However, if you chose to eat later, such as around 8pm, i would have a light snack instead, then exercise, then have your meal. Note that i am assuming you are running-if you are doing other exercises such as cycling, it should be fine to exercise not much later than your meal. With swimming, it may be worth waiting as with running, and the same could be said for weightlifting related exercises.