It is really up to you.
I find that I can do gentle exercise (walking.. even riding 6km to work) on an empty stomach.
But hard cardio I simply do not have the energy, so I will eat something small (banana or a slice of bread, or 1/2 my dinner) 30-60 minutes before exercise.
So I think 30 minutes is enough, or straight away would be ok for something like a banana. Don't drink heaps of water before you exercise as that can be uncomfortable... drink water earlier in the day.
For exercising after dinner... i'd wait 30 minutes after eating.
Starting Weight: 62kg Current Weight: 55.0kg Goal Weight: 54kg
Goal Reached 22 February 2008, Must get down to 54kg again!