Body fat doesn't have a watch, so how does it know what time it is? This idea that if you eat after 6 or 8 o'clock at night you will just inevitably start storing fat, because that is the perceived "fat storage cut off point". This couldn't be further from the truth. Unless your a "Gremlin" you shouldn't have to worry about eating after midnight.
The real issue, when it comes to late night eating, many people consume more calories because it has been too long since they have last eaten and they are very hungry. This does not mean eating before bed makes you gain weight. It confirms that eating too much makes you gain weight – an important difference. So if you haven't consumed the necessary daily calories for your bodies needs, by all means you should eat something. What you eat is just as important, as there are low quality foods and high quality foods, but the goal is to eat enough calories to support your bodies daily functions and activity. In addition no matter what time it is you should limit your consumption of high fat, high sugar, and high calorie foods.
What is most important to understand is that weight gain and weight loss occurs over a continuum (a period of time of weeks, months, years), and not hour by hour. Understand that the body doesn't stop working just because we your sleeping. Your heart is beating, blood is flowing, hormones are being released, and cells are dividing. So you are still burning calories overnight.
So please be advised that there isn't any special time on a clock where your body will store more fat. In addition the calories in the food do not all of a sudden get higher just because it is after 8pm. So what really matters is how many calories you eat and burn over the course of a day, week, and month. In the end the only thing that matters is calories in vs. calories out.