I do recommend you that you eat no later than 17-18 PM since the later you eat, the worse the digestion and stomach functions are. We need to provide enough time for the body to digest the food properly. That way, we will wake up strong and fresh as daisies every morning.
When not following this simple principle and grab something to eat quite late at night, like in 23:30 PM, the stomach won't be able to assimilate the food altogether, plus it will hinder the heart all the way due to your full stomach and last but not least you can say goodbye to the healthy sleep.
Avoid consumption of food right before you go to bed as you should make it a habit of yours - the dinner should be consisted of foods that are easy to digest, such as mild veggies, yogurt, etc. Don't choose such foods that are hard to digest, such as pickled ones as well as legumes, carrots, turnip, kohlrabi, etc.