It doesnt matter when you eat, it only matters what you eat. Personally I love to eat before bed as to avoid low blood sugar during the night. If you have very bad nightmares, it could mean your sugar is getting too low in the night. In order to keep it up, you want to eat complex carbs, maybe some long grain rice and a glass of almond milk, or anything high in fiber. My personal fave would be a salad with fake bacon bits, and a cucumber with the peal. Always include the fiber bc it contains the complex carbs that keep your sugar level through the night. Avoid foods high in sugar before bed, because that would cause your sugar to drop just as soon as it has been elevated, leaving you with nightmares.